Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SP to UPdate table 1

Status
Not open for further replies.

IanWaterman

Programmer
Joined
Jun 26, 2002
Messages
3,511
Location
GB
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.

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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top