[dba-SQLServer] Manually recreate database structure

jwcolby jwcolby at colbyconsulting.com
Sat Jul 23 00:40:58 CDT 2011


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?

-- 
John W. Colby
www.ColbyConsulting.com


More information about the dba-SQLServer mailing list