Click here to Skip to main content
15,898,134 members
Home / Discussions / Database
   

Database

 
QuestionData Base administrator vs software developer Pin
saurabhspk2-Jun-13 9:18
saurabhspk2-Jun-13 9:18 
AnswerRe: Data Base administrator vs software developer Pin
PIEBALDconsult2-Jun-13 9:48
mvePIEBALDconsult2-Jun-13 9:48 
AnswerRe: Data Base administrator vs software developer Pin
Mycroft Holmes2-Jun-13 11:16
professionalMycroft Holmes2-Jun-13 11:16 
AnswerRe: Data Base administrator vs software developer Pin
Richard MacCutchan2-Jun-13 20:56
mveRichard MacCutchan2-Jun-13 20:56 
GeneralRe: Data Base administrator vs software developer Pin
saurabhspk4-Jul-13 9:57
saurabhspk4-Jul-13 9:57 
GeneralRe: Data Base administrator vs software developer Pin
Richard MacCutchan4-Jul-13 20:49
mveRichard MacCutchan4-Jul-13 20:49 
AnswerRe: Data Base administrator vs software developer Pin
Bernhard Hiller2-Jun-13 22:47
Bernhard Hiller2-Jun-13 22:47 
AnswerRe: Data Base administrator vs software developer Pin
jschell3-Jun-13 9:07
jschell3-Jun-13 9:07 
GeneralRe: Data Base administrator vs software developer Pin
SudhirKankal4-Jun-13 23:56
SudhirKankal4-Jun-13 23:56 
AnswerRe: Data Base administrator vs software developer Pin
Saranya-from-Tamil-Nadu-India6-Jun-13 23:58
Saranya-from-Tamil-Nadu-India6-Jun-13 23:58 
QuestionInserting Master and DEtail Tables Pin
indian14331-May-13 14:53
indian14331-May-13 14:53 
AnswerRe: Inserting Master and DEtail Tables Pin
Mycroft Holmes1-Jun-13 2:35
professionalMycroft Holmes1-Jun-13 2:35 
GeneralRe: Inserting Master and DEtail Tables Pin
indian1431-Jun-13 17:38
indian1431-Jun-13 17:38 
GeneralRe: Inserting Master and DEtail Tables Pin
Mycroft Holmes1-Jun-13 17:59
professionalMycroft Holmes1-Jun-13 17:59 
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 

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.