Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

You'd like to load lots of historical data... Expand / Collapse
Author
Message
Posted Friday, December 6, 2013 10:02 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: 2 days ago @ 7:24 PM
Points: 33,930, Visits: 18,039
Comments posted to this topic are about the item You'd like to load lots of historical data...






Follow me on Twitter: @way0utwest

Forum Etiquette: How to post data/code on a forum to get the best help
Post #1520656
Posted Tuesday, March 15, 2016 7:00 AM
SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: 2 days ago @ 5:37 AM
Points: 7,886, Visits: 763
We had to do this when we were migrating data to our new system.
Post #1769451
Posted Tuesday, March 15, 2016 7:42 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: 2 days ago @ 12:30 PM
Points: 3,616, Visits: 8,361
.. You wish to temporarily disable all foreign key constraints on the table since this is an archive database and you orphaned records are acceptable for this one load only ..


The question was asking how to temporarily disable the constraints, but the real question is:
Why you would even want to keep foreign key constraints on a historical archive table that you know will contain orphan rows?



"If you break a few eggs, then make an omelet."
Post #1769473
Posted Tuesday, March 15, 2016 11:28 PM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Yesterday @ 8:29 PM
Points: 40,969, Visits: 38,258
Eric M Russell (3/15/2016)
.. You wish to temporarily disable all foreign key constraints on the table since this is an archive database and you orphaned records are acceptable for this one load only ..


The question was asking how to temporarily disable the constraints, but the real question is:
Why you would even want to keep foreign key constraints on a historical archive table that you know will contain orphan rows?


<headdesk> You beat me to it again except that I'll ask why would anyone even think of adding FKs to a history table? Ostensibly, the source table has FKs that already checked the data and those FKs could change over time. History tables need to accurately record what happened and when. There should never be FKs on history/audit tables.

It did, however, make for an interesting question.


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

Helpful Links:
How to post code problems
How to post performance problems
Post #1769799
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse