e1785 (12/13/2010)
OK. But I take it there's no way to keep it as a "disabled" constraint, as you can with FK checks? The goal is to have the same sort of handy output that I can get with DBCC CHECKCONSTRAINTS WITH ALL_CONSTRAINTS, so I can see the bad data.
see the results
create table textpk
( id int primary key
)
create table textfk
( id1 int )
ALTER TABLE textfk
ADD CONSTRAINT FK FOREIGN KEY (id1)
REFERENCES textpk (ID) ;
ALTER TABLE textpk
drop CONSTRAINT PK__textpk__27E3AA06
Msg 3725, Level 16, State 0, Line 2
The constraint 'PK__textpk__27E3AA06' is being referenced by table 'textfk', foreign key constraint 'FK'.
Msg 3727, Level 16, State 0, Line 2
Could not drop constraint. See previous errors.
you cant disable PK unless disabling FK first
-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done;-)