Hi - I am trying to write a stored procedure to export the data from a table to excel document.
May I know how to do this, I tried to in the below way but that did not work.
INSERT INTO OPENROWSET ('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=C:\Report\test.xls;','Select * from [GasEUR$]')
SELECT * FROM Report_temp
Error: Cannot create an instance of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)".
The excel document was not created before hand so is it possible to write a stored procedure that creates the excel document and exports data from table Report_temp to that excel.
Thanks,
2) That you have the write/read permissions for the folder you are accessing.
3) If its a 64 bit machine, then you may need to use 64 bit driver connection string for excel.
HTH.