I have created a procedure that first deletes the records from my table and then imports them from excel.
DELETE tabla WHERE columna='dato'
INSERT INTO tabla
SELEC *
FROM OPENDATASOURCE
('Microsoft.ACE.OLEDB.12.0',
'Data Source=\compartido\carpeta\archivo_excel.xlsm;Extended Properties=Excel 12.0'
)...[tbHoja$]
When executed, it deletes the records. But when trying to connect to Excel to recover the data I get this error message:
The OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)" reported an error. The provider did not give any information about the error.
Can not initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)".
I tried to create a procedure where only the import is executed and it works, but what I need is that when calling a single procedure it is deleted and imported.
Since to solve this I had to restart the service of the server and until now it takes time, besides the ideal is that it is automatic and that the executions are not so manual.