I have some SQL skill but I have a problem:
I currently get a monthly excel sheet via email containing 1 sheet of information. I need to be able to completely update and replace a table in SQL server 2008 (express) with this information.
I have tried to create a proceedure to drop the table and recreate it using something like this
Drop Table Utah
Create table Utah
Insert into dbo.[Utah]
Select * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=c:< .sxl file here>;HDR=YES',
'SELECT * FROM [Utah]')
But im not having any luck when I try to make a proceedure for this.
Each step seems to work on its own but to streamline this and make it easy for others to do – Can you help me please?
The best way to handle this is to create SSIS job.
There you can automate the process to handle excel files and refresh the sql tables and all.Its going to be very smooth and handy.
In case of SQL Express tyr to run this code as Sproc