Click here to Skip to main content
15,888,330 members
Home / Discussions / Database
   

Database

 
GeneralRe: Inserting Master and DEtail Tables Pin
Mycroft Holmes2-Jun-13 12:35
professionalMycroft Holmes2-Jun-13 12:35 
GeneralRe: Inserting Master and DEtail Tables Pin
indian1432-Jun-13 13:54
indian1432-Jun-13 13:54 
GeneralRe: Inserting Master and DEtail Tables Pin
Mycroft Holmes2-Jun-13 14:29
professionalMycroft Holmes2-Jun-13 14:29 
GeneralRe: Inserting Master and DEtail Tables Pin
indian1432-Jun-13 19:15
indian1432-Jun-13 19:15 
GeneralRe: Inserting Master and DEtail Tables Pin
Mycroft Holmes2-Jun-13 20:02
professionalMycroft Holmes2-Jun-13 20:02 
GeneralRe: Inserting Master and DEtail Tables Pin
indian1433-Jun-13 7:12
indian1433-Jun-13 7:12 
GeneralRe: Inserting Master and DEtail Tables Pin
indian14311-Jun-13 7:59
indian14311-Jun-13 7:59 
GeneralRe: Inserting Master and DEtail Tables Pin
Ralph D. Wilson II10-Jul-13 9:42
Ralph D. Wilson II10-Jul-13 9:42 
Abdul,

My questions here are:
1. Can I write logic in SSIS to update if the record already exists and certains columns are same, if so how can I do that.
2. If I incorporate logic into SSIS, can the performance be same as simple import process. Because the simple import process in SSIS uses the bulk insert mechanism with batch inserts of records.



The answer to your question isn't as simple as you may think. In the first place, your use of the phrase "can I" adds to the problem because it seems that you are very much an SSIS novice. so let me approach this in anothe way.

1. An SSIS package can be created that would handle your problem. The trick is to use the MERGE statement that is available in T-SQL. You can also use a pair of SQL statements such as those that you provided in your most recent post. Howver, your SQL code may be impacting our performance somewhat because you are using the IN (SELECT....) instead of using the INNER JOIN approach to determining which rows to update.

2. A straight forward bulk load is always going to be the fastest choice; however, since you need to UPDATE some rows and INSERT others, that option isn't available to you,so there's no point in worrying about that. Wink | ;-)

That being said, though, if this is your first SSIS package, I would suggest that you create a temp table into which you the INSERT both updated versions of the existing rows and then the new rows (with the IDENTITY INSERT ON, so that you can keep the IDs of the existing rows), and then truncate the existing table and reload it from the temp table. Wink | ;-)
Questionquery error Pin
Bhairava Prasad30-May-13 2:03
Bhairava Prasad30-May-13 2:03 
AnswerRe: query error Pin
Anurag Sinha V30-May-13 2:25
Anurag Sinha V30-May-13 2:25 
AnswerRe: query error Pin
Mycroft Holmes30-May-13 12:03
professionalMycroft Holmes30-May-13 12:03 
AnswerRe: query error Pin
Azarudhin4-Jun-13 3:41
professionalAzarudhin4-Jun-13 3:41 
QuestionMultiple Join to the same field Pin
Jassim Rahma29-May-13 4:31
Jassim Rahma29-May-13 4:31 
AnswerRe: Multiple Join to the same field Pin
David Mujica29-May-13 4:56
David Mujica29-May-13 4:56 
AnswerRe: Multiple Join to the same field Pin
Mycroft Holmes29-May-13 12:49
professionalMycroft Holmes29-May-13 12:49 
QuestionSelect top 2 not working on Maximum Record using SQL Pin
SE Ubaid29-May-13 2:38
SE Ubaid29-May-13 2:38 
AnswerRe: Select top 2 not working on Maximum Record using SQL Pin
Eddy Vluggen29-May-13 3:17
professionalEddy Vluggen29-May-13 3:17 
AnswerRe: Select top 2 not working on Maximum Record using SQL Pin
Arman S.29-May-13 9:44
Arman S.29-May-13 9:44 
Questiondecryption Pin
Member 870181328-May-13 6:42
Member 870181328-May-13 6:42 
AnswerRe: decryption Pin
R. Giskard Reventlov28-May-13 7:43
R. Giskard Reventlov28-May-13 7:43 
QuestionRe: decryption Pin
Eddy Vluggen28-May-13 9:45
professionalEddy Vluggen28-May-13 9:45 
AnswerRe: decryption Pin
Member 870181330-May-13 16:37
Member 870181330-May-13 16:37 
GeneralRe: decryption Pin
Eddy Vluggen31-May-13 6:23
professionalEddy Vluggen31-May-13 6:23 
AnswerRe: decryption Pin
poongunrans28-May-13 20:21
poongunrans28-May-13 20:21 
QuestionSQL Pin
Shiv irfi26-May-13 21:11
Shiv irfi26-May-13 21:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.