CHECK constraint dependencies upon user-defined functions?
jalbert
Posts: 18
I have a project that has a CLR assembly, several user-defined functions which call the assembly, as well as tables that have CHECK constraints which refer to those user-defined functions. I am using the new functionality which allows me to compare scripts with a database.
When I modify the assembly, SQL Compare 6 properly determines that the user-defined functions are dependent upon the assembly. (It generates the required DROP FUNCTION and CREATE FUNCTION statements in the synchronization script.) However, it does not appear to detect that the user-defined functions are used by the table-level CHECK constraints. Therefore when I attempt to synchronize, I get an error message similar to:
Cannot DROP FUNCTION 'dbo.SomeFunction' because it is being referenced by object 'some_table_check_constraint'.
Is there a setting that I should check to get this to behave properly?
When I modify the assembly, SQL Compare 6 properly determines that the user-defined functions are dependent upon the assembly. (It generates the required DROP FUNCTION and CREATE FUNCTION statements in the synchronization script.) However, it does not appear to detect that the user-defined functions are used by the table-level CHECK constraints. Therefore when I attempt to synchronize, I get an error message similar to:
Cannot DROP FUNCTION 'dbo.SomeFunction' because it is being referenced by object 'some_table_check_constraint'.
Is there a setting that I should check to get this to behave properly?
Comments
I've forwarded this issue to the relevant developer, but we've just frozen development on 6.1 so I can't give you a timescale for when a fix will be available. (Hopefully we'll be able to get it into the next point release, which is mostly dealing with source control issues, but dependancy issues concerning CLR objects are quite tricky, so it depends how much development time we have available.)
Redgate Software
http://mattwhetton.blogspot.com
i have same problem is lastest version but i cant resolve it
thanks