Click here to Skip to main content
15,895,142 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I want to import excel data into sql-2005 table.

I know how to do it with GUI but the problem I am facing is I have a primary key defined in my table hence when I import data from excel if it has duplicate data it fails due to primary key.

Otherwise it imports successfully.

So I want to edit records in excel file and add new records in excel.
If edited, I want it to be updated in table(Sql) during import process, otherwise I want the record to be inserted in table(sql) during import process.

How can I do this.
Posted
Updated 8-Sep-10 21:44pm
v2
Comments
Dalek Dave 9-Sep-10 3:44am    
Edited for Grammar and Syntax.

1 solution

You can use SSIS to perform this task. It's more advanced then the default Import/Export component from the Management Studio.

But if what you are trying to do is only a temporary (one time) action, you might be better of just creating some batch tool or just reloading the whole table.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900