Hi you giy helped me to get this to work. Thank you I just have one more question that I do not seem to be able to find anywhere.
How can I get coulmn names (headings) in the Excel sheet here?
Here is my code:
Declare @bcp varchar(150)
SELECT @bcp = 'bcp " Select [CompanyName] from NOTTHWIND.dbo.Customers " queryout C:\AestEd2.xls -T -c -S' + @@servername
exec Master..xp_cmdshell @bcp
View Complete Post