Deploying modified UDF that is referenced by a constraint

MckMurrayMckMurray Posts: 37 Bronze 4
edited May 27, 2016 10:54AM in SQL Compare 11
We have a lot of table check constraints where the validation logic is encapsulated in a scalar UDF. In order to successfully deploy changes to such objects, it is necessary to first drop the referencing constraint, make changes to the function, and then re-create the constraint, otherwise you get an error like "Cannot ALTER 'dbo.ScalarFunction' because it is being referenced by object 'TableName'."

It would appear SQL Compare attempts to simply modify the UDF, which means I have to manually go in and fix the deployment script for any deployment that touches one of these UDFs.

This would appear to be a bug - has anyone else run into this?

Comments

Sign In or Register to comment.