SQL Import to update existing records?
Posted
by Kenundrum
on Server Fault
See other posts from Server Fault
or by Kenundrum
Published on 2010-01-11T16:25:44Z
Indexed on
2010/03/13
6:15 UTC
Read the original article
Hit count: 461
I've got a table in a database that contains costs for items that gets updated monthly. To update these costs, we have someone export the table, do some magic in excel, and then import the table back to the database. We're running MSSQL 2005 and using the built in SQL Management Studio. The problem is that when importing back into the table, we have to delete all the records before we import or else we'll get errors. The ideal situation would be for the import to recognize the primary keys and then update the records instead of trying to create a second record with a duplicate key- halting the import. The best illustration of the behavior we're trying to get can be found at http://sqlmanager.net/en/products/mssql/dataimport/documentation/hs2180.html the update or insert example. Is something like this possible with the built in tools or do we have to get third party software to make it happen?
© Server Fault or respective owner