February 22, 2008 at 4:08 pm
HI All,
I was wonder if anybody knows how to insert to the table ( from flat file source) only rows that don't exist currently in the table. At the moment I'm using truncate table in SQL statement and brings back all data ( over few millions rows) but I know this is not the way to go.
Will appreciate any advise
Thanks
🙂
Leszek
February 22, 2008 at 4:24 pm
First question that needs to be answered, does the table you are inserting data into have a primary key that is a part of the data you are inserting? If not, is there a unique key that is made up of data being inserted?
(Providing the structure of the tables and flat file and some sample data for each would be quite helpful.)
😎
February 22, 2008 at 4:46 pm
HI thanks for you response. Well, there is a primary key but its not from data - its automated function used on table, its adding an id to each row, but this is made on table.
I attached some sample of data.
February 22, 2008 at 4:47 pm
and I saved it as excel file but I use csv ( row limit). I'm not sure what do you mean by structure of the table?
February 22, 2008 at 5:00 pm
Read this article:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
It will help you figure out what is needed to allow us to help you better.
I realize that for SSIS, some of it may be more difficult, but the article does cover things like table DDL, which is what I mean by the structure of the table.
😎
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply