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 |
ramemail.n
Starting Member
8 Posts |
Posted - 2010-07-28 : 12:27:48
|
declare @dateformat varchar(100)select @dateformat = convert(varchar(15), getdate(),102)select @dateformatdeclare @sql varchar(100) set @sql = 'bcp "SELECT top 10 * FROM report..carriers" queryout "D:\bcptest' + @dateformat + '.txt" -T -c -t,'select @sqlexec xp_cmdshell @sqlusing above script i am able to copy the data from table to text file but i am not getting header how to get the header in each file.Thanks,RammohanRammohan N |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|