December 22, 2008 at 3:08 am
exec master..xp_cmdshell 'bcp "SELECT au_fname, au_lname FROM pubs..authors
ORDER BY au_lname" queryout c:\file.txt -T -SBLRKEC24506\INFY -c'
when I execute the above code i come across the belwo output, please help me get the desired output. Also please let me know if theres any way to get the results of a system stored procedure into a text file.
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] [-V file format version] [-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"] [-x generate xml format file]
NULL
Thanks,
Sid
December 22, 2008 at 3:55 am
Hi,
Write whole command in single line, remove line break(s) from the parameter of xp_cmpshell procedure
Best Regards
Nitin
Regards,
Nitin
December 22, 2008 at 6:19 am
exec master..xp_cmdshell 'bcp "SELECT au_fname, au_lname FROM pubs..authors ORDER BY au_lname" queryout c:\file.txt -T -S[BLRKEC24506\INFY] -c'
N 56°04'39.16"
E 12°55'05.25"
December 22, 2008 at 9:12 pm
thanks all...
it worked
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply