Larry Brister
asked on
SQL Server bcp command
I have to cammand below which is crewating a file...just not actually in excel format. So I know I have my switches wrong for export to excel.
Some help here?
exec master.dbo.xp_cmdshell 'bcp "select * from database.dbo.table1" queryout C:\excelfile.xls -w -S SERVER\INSTANCE -T -E'
Some help here?
exec master.dbo.xp_cmdshell 'bcp "select * from database.dbo.table1" queryout C:\excelfile.xls -w -S SERVER\INSTANCE -T -E'
It won't. You would have to export into character format which created a TAB delimited file and then import that into excel. Just hope your data contains no tabs.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.