I need to automate the procedure to automatically append data into the tables after every 2 hrs from an excel file.
Is it possible using Store Procedure.
I need to automate the procedure to automatically append data into the tables after every 2 hrs from an excel file.
Is it possible using Store Procedure.
there are a few options
Which are you more comfortable with
I'm asked to create a store procedure that would automatically update the tables from excel sheet every 2 hrs. Can it be done using OpenRowsheet.
yes it can be done using OPENROWSET
insert into Staging
SELECT *
FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0','Excel 12.0; Database=C:\FTPdrop\Data.xlsx', [Sheet1$]);
C:\FTPdrop is on the server.
Needed to install this
https://www.microsoft.com/en-us/download/details.aspx?id=13255
then using SQL Server Job you schedule it to run every hour and make the call to the stored procedure.