Within a stored procedure I am creating a table from an Excel spreadsheet
Then joining this table to update another with new products
consum_stk also has a last_updated column with GETDATE() as default.
Is it possible to use the Excel file 'modified' date property to populate this field
Code:
/*Create tmp table from XLS*/
SELECT * INTO tmp_cons FROM
OPENROWSET('Microsoft.Jet.OLEDB.4.0','Excel 8.0;
Database=\\[server]\path\to\Excel\spreadsheet.xls',
'SELECT * FROM [sheet1$]')
Code:
INSERT INTO consum_stk (part,qty) SELECT tmp_cons.Part,Stock FROM tmp_cons LEFT JOIN consum_stk ON tmp_cons.Part = consum_stk.part WHERE consum_stk.part IS NULL
Is it possible to use the Excel file 'modified' date property to populate this field
Comment