Friends

Wednesday, August 24, 2011

Export tables to excel sheet

create columns name in the excel sheet n save it.

then execute this


--Enables component 'Ad Hoc Distributed Queries' by using sp_configure
EXEC sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
EXEC sp_configure 'Ad Hoc Distributed Queries', 1;
GO
RECONFIGURE;
GO


INSERT INTO OPENROWSET ('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=e:\Book1.xls;','Select * from [sheet1$]')
SELECT * FROM tbl_images

No comments:

Post a Comment