|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Wednesday, May 15, 2013 8:55 AM
Points: 137,
Visits: 250
|
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Thursday, March 07, 2013 12:16 AM
Points: 381,
Visits: 340
|
|
Hello there,
when i execute part1 and part2 together the whole query is executing properly, but it is not restoring the FK constraints properly.
can anybody help me on this regard?.....
Thanks&Regards, Ramu
Ramu No Dream Is Too Big....!
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Wednesday, May 15, 2013 8:55 AM
Points: 137,
Visits: 250
|
|
| What's seems to be the problem
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Thursday, March 07, 2013 12:16 AM
Points: 381,
Visits: 340
|
|
I've a database which has, two dimension and one fact table.
when i run the script, it is restoring primary keys successfully, but not FK relations in the fact table.
I mean my fact table doesn't hold any relation with the dimension tables after running the script.
Please tell me what might be the problem?.. is it with my database or script?
Regards, Ramu
Ramu No Dream Is Too Big....!
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Wednesday, May 15, 2013 8:55 AM
Points: 137,
Visits: 250
|
|
| One of the problems that I see a lot is that when trying to restore the relationship there are orphans on the tables. Ensure that all the foreign keys from the parent are present on the tables. For example. If table A has ID ( 1,2,3,4,5,6) and a child table B has the FK's (1,4,5,6) After dropping all the constraints we delete the records (5,6) on table A but fail to delete records (5,6) on table B, the script will fail to restore the constraint between Table A and B because now B has FK's (5,6) as orphans. The issue can be many things but I will start to look into the orphan issue First. Can you send the DDL of the tables? or a similar DDL I just want to see the kind of constraint between the tables.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, October 28, 2010 11:52 AM
Points: 1,
Visits: 31
|
|
Jorge,
This is great stuff!
However, it seems as though the restore portion does not correctly restore relationships that are based on more than one column.
I think there needs to be a loop in the dynamic sql section that will iterate through the values in the sysforeignkeys.keyno field. You capture that data in the first part, but do not appear to use it in the restore process.
If I am incorrect, my sincerest apologies. I ask only because I would hate to lose the multi-column FK relationships on my databases!
-Dave
|
|
|
|