It works:
SELECT * FROM OPENDATASOURCE( 'Microsoft.ACE.OLEDB.12.0', 'Data Source=d:\JobFiles\MyFile.xlsx; Extended properties=Excel 8.0')...MySheet$
So does it:
INSERT INTO OPENDATASOURCE( 'Microsoft.ACE.OLEDB.12.0', 'Data Source=d:\JobFiles\MyFile.xlsx; Extended properties=Excel 8.0')...MySheet$ SELECT * FROM blahblahblah
So why not?
DELETE FROM OPENDATASOURCE( 'Microsoft.ACE.OLEDB.12.0', 'Data Source=d:\JobFiles\MyFile.xlsx; Extended properties=Excel 8.0')...MySheet$
I did some searches without real luck. In the end, all I need is excel rows deleted before I can insert fresh data, and I want to achieve this only with SQL.
source share