Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 437
  • Last Modified:

BCP out .csv with Pipe problem

I need to bcp out a pipe delimimted .csv file.  The following is giving me a command line error. What's wrong with it?



declare @sql varchar(8000)
select @sql = 'bcp Test..Property1 out c:\Temp\property1.txt -c -t| -T -S' + @@servername
exec Test..xp_cmdshell @sql
 
Here's the output error:
'-T' is not recognized as an internal or external command,
operable program or batch file.
NULL

Open in new window

0
Lawrence Barnes
Asked:
Lawrence Barnes
1 Solution
 
MohammedUCommented:
Try the following..

declare @sql varchar(8000)
select @sql = 'bcp pubs..authors out c:\Temp\property1.txt -c -t"|" -T -S' + @@servername
 
exec master..xp_cmdshell @sql
 
0
 
Lawrence BarnesAuthor Commented:
Thank you
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now