Writing Sql Results to Excel Sheet

Its a one line query which writes the result set to Excel Sheet. OpenRowSet loads the driver, open Excel connection string and writes the data into specified location. INSERT INTO OPENROWSET (‘Microsoft.Jet.OLEDB.4.0’, ‘Excel 8.0;database=C:\test.xls’, ‘SELECT * FROM [Sheet1$B4:D4]’) SELECT ‘aaa’, ‘bbb’, ‘ccc’ –Select statement can be replaced with your own Select Statement from the database… Read More Writing Sql Results to Excel Sheet