Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

BCP - Generate CSV from SQL - syntax

Posted on 2011-09-22
3
Medium Priority
?
626 Views
Last Modified: 2012-05-12


I tried

C:\Users\luj>BCP poserv4..vw_posnos out c:\posnos.csv -c -T -t, -S<poserv4> from dos prompt
but i get back..
The syntax of the command is incorrect.

what could be wrong? -T is trusted (windows authentication> -t is to separate by comma
poserv4 is the server name.. i want the results of the view vw_posnos into csv format..
0
Comment
Question by:25112
  • 2
3 Comments
 
LVL 13

Accepted Solution

by:
Wizilling earned 2000 total points
ID: 36584574


Try space after -S
ie. -S posserv4

you are not using the < > in the bcp command, are you?
0
 
LVL 5

Author Comment

by:25112
ID: 36586411
first i was using <>.. i changed it but still fails..
C:\Users\luj>BCP poserv4..vw_posnos out c:\posnos.csv -c -t, -T -Sposerv4
Unknown argument 'ûSposerv4' on command line.

C:\Users\luj>BCP poserv4..vw_posnos out c:\posnos.csv -c -t, -T -S poserv4
Unknown argument 'ûS' on command line.

C:\Users\luj>
0
 
LVL 5

Author Comment

by:25112
ID: 36587432
it must have been a illegible characters.. i typed again slowly and it worked.. thanks Wizilling:
0

Featured Post

[Webinar] Cloud Security

In this webinar you will learn:

-Why existing firewall and DMZ architectures are not suited for securing cloud applications
-How to make your enterprise “Cloud Ready”, and fix your aging DMZ architecture
-How to transform your enterprise and become a Cloud Enabler

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What we learned in Webroot's webinar on multi-vector protection.
How much do you know about the future of data centers? If you're like 50% of organizations, then it's probably not enough. Read on to get up to speed on this emerging field.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question