Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
bhaskar.rm
Starting Member
6 Posts |
Posted - 2009-09-10 : 05:06:50
|
| XP_cmdshell 'bcp.exe -Q"Query" -o C:\Filepath.xls -c -T'.i Cannot be able to execute this code..It showing ErrorCopy direction must be either 'in', 'out' or 'format'.usage: bcp.exe {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]Bhaskar |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-09-10 : 06:34:17
|
| Are you trying to export data to EXCEL file?MadhivananFailing to plan is Planning to fail |
 |
|
|
bhaskar.rm
Starting Member
6 Posts |
Posted - 2009-09-10 : 08:38:13
|
| yes i am trying to export the query result to excel fileBhaskar |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
bhaskar.rm
Starting Member
6 Posts |
Posted - 2009-09-11 : 01:47:11
|
| thanks Madhivanan. It helped me a lot!Bhaskar |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-09-11 : 02:50:31
|
quote: Originally posted by bhaskar.rm thanks Madhivanan. It helped me a lot!Bhaskar
You are welcome MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|