Solved

BCP - Generate CSV from SQL - syntax

Posted on 2011-09-22
3
597 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 13

Accepted Solution

by:
Wizilling earned 500 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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Suggested Solutions

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

733 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