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
Solved

BCP - Generate CSV from SQL - syntax

Posted on 2011-09-22
3
592 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 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Many companies are looking to get out of the datacenter business and to services like Microsoft Azure to provide Infrastructure as a Service (IaaS) solutions for legacy client server workloads, rather than continuing to make capital investments in h…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how the fundamental information of how to create a table.

809 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