[dba-SQLServer]Temporarily Disable Default Constraint

Francisco H Tapia my.lists at verizon.net
Fri Jan 30 09:55:29 CST 2004


I had created a UDF that spits back some data, I need to alter the UDF 

but it's listed in more than one table as the default... How do I 
temporarily disable it?

The error I get is:

Server: Msg 3729, Level 16, State 3, Procedure udfMYFunction, Line 31
Cannot ALTER 'udfMyFunction' because it is being referenced by object 
'DF_tbl_MyTable_MyColumn'.


any ideas?

I thought I could just do this  but it doesnt work..

ALTER TABLE Tbl_MyTable NOCHECK CONSTRAINT DF_tbl_MyTable_MyColumn

but that doesn't seem to help because immediately I have my other script

alter Function udfMYFunction() AS ...
-- 
-Francisco



More information about the dba-SQLServer mailing list