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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update Table using DTS

Status
Not open for further replies.

Eli20

Programmer
Oct 30, 2003
119
MX
hi, i have a table in MS SQL 2000 named clients.

Every week i get an excel file whith the clients data updates, the excel file can contain changes in existing clients (there is a client number, which is the primary key for the table) or new clients.

I created a DTS to update the table, but what ive been doing so far is to drop the existing table, and create a new one, with all the new data.

Its been working fine, but i think its a loss of time and performance, is there a way to just update the existing data in the table??

And another question, from the same excel file, im populating another table, that keeps the user name (client name) and password of each client.
I was doing the same thing as before, drop the table and create it again, but users can change their passwords from my application, so i cannt load the passwords from the excel file, because they are not correct. i just need to add the new users with the default password.

im kind of new to DTS, and im not sure of how to solve this. can anybody post a code example, or explain me how to do it??


thank you very much
Eli.
 
I would create a working table where you load the lastest excel spreadsheet into. From there you could JOIN on the main table and make your changes of user that already exist. You would then perform a NOT EXISTS against the main user table to find out which users do not exist and then add them to your main table. Books OnLine will give you the proper syntax for each of these tasks.

Thanks

J. Kusch
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top