To Export .xls file to sql :
sp_configure 'show advanced options',1
reconfigure
sp_configure 'Ad Hoc Distributed Queries',1
insert into openrowset('Microsoft.Jet.OLEDB.4.0','Excel 8.0;database=d:\new.xls','select * from [sheet1$]')select * from test.dbo.tablename
To import sql to .xls file:
SELECT * INTO XLImport3 FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0',
'Data Source=d:\new.xls
No comments:
Post a Comment