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

Database

 
QuestionCrystal Reporting Pin
Morore_Charles_0074-Aug-13 21:09
Morore_Charles_0074-Aug-13 21:09 
AnswerRe: Crystal Reporting Pin
Mycroft Holmes4-Aug-13 23:00
professionalMycroft Holmes4-Aug-13 23:00 
AnswerRe: Crystal Reporting Pin
thatraja4-Oct-13 20:16
professionalthatraja4-Oct-13 20:16 
QuestionOLAP hung on Cube Full Process: Building indexes for the <Measure Group Name> partition has started. Pin
devvvy2-Aug-13 18:19
devvvy2-Aug-13 18:19 
QuestionRe: OLAP hung on Cube Full Process: Building indexes for the <Measure Group Name> partition has started. Pin
Jörgen Andersson6-Aug-13 9:45
professionalJörgen Andersson6-Aug-13 9:45 
QuestionDatabase Design to store revisions of creating an assessment Pin
civic0602-Aug-13 8:57
civic0602-Aug-13 8:57 
AnswerRe: Database Design to store revisions of creating an assessment Pin
Mycroft Holmes2-Aug-13 14:26
professionalMycroft Holmes2-Aug-13 14:26 
QuestionGetting Foreign Key Constraint Error Unusually Pin
indian1432-Aug-13 8:32
indian1432-Aug-13 8:32 
Hi All,

I have a stored procedure that is inserting some values in Master and details table and I am getting the following error. Some times I am getting this error but some times I am not getting this error. When I am inserting detail table values I am checking everything if I am inserting any values that are not there in the Master table, but I am not getting any sign that I am inserting any values that are not there in Master table.
The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Identifier_Entity". The conflict occurred in database "IdentityResolutionService", table "dbo.Entity", column 'EntityId'.

My scenario is: I have Entity table, Identifier table, Entity is the master table Identifier is the detail table. I am actually taking data from another table called Students to load all the students of a state, sid, dsid and ssn are the columns that are important from the students table. One sid may have multiple dsids depending upon year, school district etc, one ssn one sid. Now I have taken Rank on the SID to load all this data from Students table to Staging table. Now I have taken all the distinct SIDs and put it into Master table.
In the Identifier table when I am loading the SIDs, DSIDs and SSNs, I have taken the corresponding Rank value for that row, instead of creating one. I explained this only because there is no way that I can miss the Foreign key relationship. But one thing when I am loading the Entity values I am making it as Auto increment off, insert statement and then making it on because there is another application that is using the same table as auto increment on. But another thing is as the user doesn't have alter table permissions, I have created a Stored Proc which takes table name and insert statement as parameters so that I can make auto increment off and run the insert command in the parameter and makes auto increment on. After doing this I make auto increment on. This stored procedure runs under proxy user account.
Then I run insert into Identifier table, some how the insert into Identifier table is failing with the above error message. What could be the reason. Some time it works, some time doesnt. Is it because of dynamic sql or proxy user or the huge amount of data that is being processed because of all the students in a state, like around 4 or 5 million records am processing. In the Identifier table it is having more than 10 million records or am I doing any mistake. Because of its hugeness I am unable to debug the Stored Proc also very well the reason is it runs for an hour or something. All the time is going just in testing.

Is there any other reasons apart from unavailable values in master-detail tables for Foreign key constraint failure.

Please understand me and help me whatever you can, that would really great.
Thanks & Regards,

Abdul Aleem Mohammad
St Louis MO - USA

AnswerRe: Getting Foreign Key Constraint Error Unusually Pin
Mycroft Holmes2-Aug-13 14:20
professionalMycroft Holmes2-Aug-13 14:20 
GeneralRe: Getting Foreign Key Constraint Error Unusually Pin
indian1432-Aug-13 17:04
indian1432-Aug-13 17:04 
AnswerRe: Getting Foreign Key Constraint Error Unusually Pin
jschell2-Aug-13 14:33
jschell2-Aug-13 14:33 
GeneralRe: Getting Foreign Key Constraint Error Unusually Pin
indian1432-Aug-13 17:01
indian1432-Aug-13 17:01 
Questionwhats diffrence between in two query in performance respect Pin
mhd.sbt2-Aug-13 5:48
mhd.sbt2-Aug-13 5:48 
AnswerRe: whats diffrence between in two query in performance respect Pin
Eddy Vluggen2-Aug-13 8:32
professionalEddy Vluggen2-Aug-13 8:32 
QuestionDatabase for Bridge Asset Management Pin
Nebilo1-Aug-13 22:25
Nebilo1-Aug-13 22:25 
AnswerRe: Database for Bridge Asset Management Pin
Bernhard Hiller2-Aug-13 0:10
Bernhard Hiller2-Aug-13 0:10 
JokeRe: Database for Bridge Asset Management Pin
Mycroft Holmes2-Aug-13 1:07
professionalMycroft Holmes2-Aug-13 1:07 
GeneralRe: Database for Bridge Asset Management Pin
Nebilo2-Aug-13 1:47
Nebilo2-Aug-13 1:47 
AnswerRe: Database for Bridge Asset Management Pin
Eddy Vluggen2-Aug-13 0:29
professionalEddy Vluggen2-Aug-13 0:29 
Questionface time out when run query with nested select Pin
mhd.sbt1-Aug-13 21:54
mhd.sbt1-Aug-13 21:54 
AnswerRe: face time out when run query with nested select Pin
Bernhard Hiller2-Aug-13 0:09
Bernhard Hiller2-Aug-13 0:09 
GeneralRe: face time out when run query with nested select Pin
mhd.sbt2-Aug-13 2:45
mhd.sbt2-Aug-13 2:45 
AnswerRe: face time out when run query with nested select Pin
Eddy Vluggen2-Aug-13 0:10
professionalEddy Vluggen2-Aug-13 0:10 
GeneralRe: face time out when run query with nested select Pin
mhd.sbt2-Aug-13 2:42
mhd.sbt2-Aug-13 2:42 
GeneralRe: face time out when run query with nested select Pin
Eddy Vluggen2-Aug-13 8:27
professionalEddy Vluggen2-Aug-13 8:27 

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.