I used bcp to export data to Excel file master..xp_cmdshell 'bcp "select * from MyDB..Test" queryout "D:ex.xls" -c' It is working. But It is actually stored as Text(Tab Delimitated) type. I have to open it and do saveas and select "Microsoft Excel Workbook" to actually save it as Excel file. Is there any way to avoid this? Madhivanan Failing to plan is Planning to fail
Check this linkhttp://searchsqlserver.techtarget.com/tip/1,289483,sid87_gci1057989,00.html for alternate solution. Satya SKJ Moderator http://www.SQL-Server-Performance.Com/forum This posting is provided “AS IS†with no rights for the sake of knowledge sharing.