Ads 720 x 90

Update a table from an Excel sheet using OpenRowset

Another method without using the dts package


IF OBJECT_ID('tempdb..#temp')is not null
DROP TABLE #temp
create table #TEMP ( PK int, received datetime)
insert into #temp
SELECT * FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0',
'Data Source=c:\UrExcelFile.xls;Extended Properties=Excel 8.0')...Sheet1$ -- put ur excel filename and sheetname

Update urTable
set received =t.received
from aaa
inner join #temp t
ON urTable.PK = t.PK

DROP TABLE #temp

Related Posts

There is no other posts in this category.

Total Pageviews

Subscribe Our Newsletter