insert into OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=D:\testing.xls;', 'SELECT * FROM [Sheet1$]') select * from DataDictionary
DECLARE @cmd VARCHAR(255) SET @cmd = 'bcp "My Select Query Here" queryout "My Excel File Path Here" -U sqluserHere -P sqlpasswordHere -c' Exec xp_cmdshell @cmd
insert into OPENROWSET('Microsoft.ACE.OLEDB.12.0', 'Excel 12.0;Database=D:\testing.xlsx;', 'SELECT * FROM [Sheet1$]') select * from DataDictionary
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)