January 17, 2008 at 8:26 am
Hello
Being fairly new to SQL 2000, I could use any pointers. I have to regularly update a table with new or modified data and so need to update existing records or add new ones.
the only way I can see of doing this is to use DTS but can't find any text books or online training which shows you how to set up packages which can do manipulation. I can set up simple a - a, b - b packages by creating the correct file in VBA but need to add some SQL to check for existing file and then update or create new.
Any ideas would be appreciated.
ohsodit
January 17, 2008 at 9:45 am
It's not quite clear from your post what you need to do. Are you looking to detect a new file on disk and then perform a load? Or are you loading a file and need to compare data in the file with data that's already in the table?
If the latter, import the data to a staging table. Then you can easily do an update with matching records, delete the matches from staging and then insert the rest.
January 17, 2008 at 9:58 am
The other question I have, is the data being imported a one for one match on columns? If so, and you load the data into a staging table, identifying updates, inserts, and deletes can be done fairly easily. Best thing is to post the DDL for the tables, and some sample data. read this article to see how best to do this:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
😎
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply