October 8, 2001 at 8:56 pm
Hi all
I ran a script to disable all constraints to re-populate my reference data tables throughout the database. Before this ran, all FK constraints has the following properties enabled:
Check existing data on creation
Enforce relationship for replication
Enfore relationship for INSERT's and UPDATE's
After running this:
exec sp_msforeachtable @command1="print '?'", @command2="ALTER TABLE ? NOCHECK CONSTRAINT all"
and then this to re-enable:
exec sp_msforeachtable @command1="print '?'", @command2="ALTER TABLE ? CHECK CONSTRAINT all"
I noticed that the "Check existing data on creation" has been disabled. How can I get this back? ive tried a variety if syntax's and cant get the bugger to recheck.
Cheers
Chris
Chris Kempster
www.chriskempster.com
Author of "SQL Server Backup, Recovery & Troubleshooting"
Author of "SQL Server 2k for the Oracle DBA"
October 10, 2001 at 2:51 am
well still cant find the fix, but this command is fantastic! :
DBCC CHECKCONSTRAINTS WITH ALL_CONSTRAINTS
Chris Kempster
www.chriskempster.com
Author of "SQL Server Backup, Recovery & Troubleshooting"
Author of "SQL Server 2k for the Oracle DBA"
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy