Arthur Fuller
fuller.artful at gmail.com
Sat Jul 23 01:55:56 CDT 2011
Yes, or alternatively re-order the script's execution sequence to populate all the lookup tables first, and only then populate the main tables. FWIW, I agree that these MS tools ought to do a far better job at this, and understand in which order the tables ought to be created. A. On Sat, Jul 23, 2011 at 1:40 AM, jwcolby <jwcolby at colbyconsulting.com>wrote: > I have a database designed on SQL Server 2008 Express which is a later > version (10.50) than my full version (10.0). I cannot backup and restore > backwards nor can I detach / attach. > > Thus I am scripting as create each table and copying the script to a new > database (same name) on the older software version Server. My problem is > that the scripts have constraints which are PK/FK pairs. Each table has > these constraints but one half of the constraint will always be missing as I > run these scripts. Is there a way to tell SQL server to create but ignore > the constraints as I create the tables and even as I load the tables with > the existing data and then "turn on" the constraints at the very end? > > Or do I need to move the constraint SQL into a separate query, create the > tables, load the data and then create the constraints at the end? >