IanWaterman
Programmer
I am attempting to write a stored procedure to Delete contents of a table and then update from an xls file. This is a monthly process. I need something on the following lines, but not sure of the syntax to connect to an xls file.
Thnaks for your help
Code:
CREATE PROCEDURE dbo.usp_UpdateContacts
AS
SET NOCOUNT ON;
DELETE FROM contact;
INSERT INTO contact (ContactNo, PostNo, ContactName, TelephoneNo, Email, LocationCode, ImpactCode, ClientCode, id)
SELECT ContactNo, PostNo, ContactName, TelephoneNo, Email, LocationCode, ImpactCode, ClientCode, id
FROM C:\outputFiles\contact.xls
Thnaks for your help