bcp command runs but results do not show up in text file

bcp command runs but results do not show up in text file

Post by Mr K » Sun, 22 Apr 2001 05:29:57



This query runs but I don't find the files in F:\Backup

Here's the syntax and result set.  Thanks, Mr. K

USE Master
EXEC xp_cmdshell 'bcp  "select  * from pubs..authors" queryout
"F:\Backup\pubs.txt" -fF:\Backup\my.fmt -S. -T'

output                                                                            

usage: bcp {dbtable | query} {in | out | queryout | format} datafile
  [-m maxerrors]            [-f formatfile]       [-e errfile]
  [-F firstrow]             [-L lastrow]          [-b batchsize]
  [-n native type]          [-c character type]   [-w wide character type]
  [-N keep non-text native] [-6 6x file format]   [-q quoted identifier]
  [-C code page specifier]  [-t field terminator] [-r row terminator]
  [-i inputfile]            [-o outfile]          [-a packetsize]
  [-S server name]          [-U username]         [-P password]
  [-T trusted connection]   [-v version]          [-R regional enable]
  [-k keep null values]     [-E keep identity values]
  [-h "load hints"]

(11 row(s) affected)

 
 
 

bcp command runs but results do not show up in text file

Post by Darren Brinksneade » Sun, 22 Apr 2001 06:10:18


The 11 rows affected is the 11 rows of output returned to the QA.  There is
a syntax problem in the BCP statement.

Try this...

USE Master
EXEC xp_cmdshell 'bcp  "select  * from pubs..authors" queryout
"F:\Backup\pubs.txt" -f "F:\Backup\my.fmt" -T'

--
Darren Brinksneader MCDBA, MCSE+I, CNE, CCA, MCT, CTT


This query runs but I don't find the files in F:\Backup

Here's the syntax and result set.  Thanks, Mr. K

USE Master
EXEC xp_cmdshell 'bcp  "select  * from pubs..authors" queryout
"F:\Backup\pubs.txt" -fF:\Backup\my.fmt -S. -T'

output

usage: bcp {dbtable | query} {in | out | queryout | format} datafile
  [-m maxerrors]            [-f formatfile]       [-e errfile]
  [-F firstrow]             [-L lastrow]          [-b batchsize]
  [-n native type]          [-c character type]   [-w wide character type]
  [-N keep non-text native] [-6 6x file format]   [-q quoted identifier]
  [-C code page specifier]  [-t field terminator] [-r row terminator]
  [-i inputfile]            [-o outfile]          [-a packetsize]
  [-S server name]          [-U username]         [-P password]
  [-T trusted connection]   [-v version]          [-R regional enable]
  [-k keep null values]     [-E keep identity values]
  [-h "load hints"]

(11 row(s) affected)