Click here to Skip to main content
15,887,975 members
Home / Discussions / Database
   

Database

 
GeneralRe: Inserting Master and DEtail Tables Pin
indian1432-Jun-13 12:18
indian1432-Jun-13 12:18 
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 
Hi,

I didnt want to create another thread for this again so I am reusing the existing thread. Sorry if it causes inconvenience to you.

I have implemented as you said, there are around 3 million records. I created a staging table for loading the data temporary. Now I have to insert or update all this data in to the actual table and delete data from staging.

Now the problem that I am facing is, for certain conditions only we have to insert data but for certain conditions I have to update the data depending upon some logic.

Everything I tried has failed or took enormously huge amount of time except SSIS that too only if I use just loading with mapped columns. But that is not going to help me a lot because I have to decide insert or update depending upon some logic.

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.

I tried in the following way, but it is taking a huge amount of time to insert 3 million records. Like 7 or 8 hrs.


UPDATE [IdentityResolutionService].[dbo].[Entity]
   SET [SystemOfRecordId] = t2.[SystemOfRecordId]
      from [IdentityResolutionService].[dbo].[Entity] as t1
      inner join 
      (select DISTINCT [EntityId], SystemOfRecordId from IdentityResolutionService.dbo.Identifier_Staging where EntityId
  in (select EntityId from [IdentityResolutionService].[dbo].[Entity])) as t2 
 on t1.EntityId=t2.EntityId
 WHERE t2.EntityId = t1.EntityId and t1.SystemOfRecordId=@ACESSystemOfRecordId



INSERT INTO [IdentityResolutionService].[dbo].[Entity]
          ([EntityId]
          ,[SystemOfRecordId])
select DISTINCT [EntityId], [SystemOfRecordId] from IdentityResolutionService.dbo.Identifier_Staging where EntityId
not in (select EntityId from [IdentityResolutionService].[dbo].[Entity])
and [SystemOfRecordId] not in (select [SystemOfRecordId] from [IdentityResolutionService].[dbo].[Entity])




Thanks in advance.
Thanks & Regards,

Abdul Aleem Mohammad
St Louis MO - USA

GeneralRe: Inserting Master and DEtail Tables Pin
Ralph D. Wilson II10-Jul-13 9:42
Ralph D. Wilson II10-Jul-13 9:42 
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 

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.