CHECK constraint dependencies upon user-defined functions?

Forum for users of SQL Compare schema synchronization utility

CHECK constraint dependencies upon user-defined functions?

Postby jalbert » Thu Aug 02, 2007 6:53 pm

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?
Posts: 13
Joined: Thu Jun 28, 2007 12:28 am
Location: San Diego, California, U.S.A.

Postby Michelle Taylor » Fri Aug 03, 2007 3:47 pm

I'm afraid you've come across a bug in our dependancy handling, and there isn't an obvious workaround other than taking the functions out of the check constraints before synchronizing, or manually synchronizing the assemblies.

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.)
Michelle Taylor
Posts: 537
Joined: Mon Oct 30, 2006 11:45 am
Location: Red Gate Software

Postby jalbert » Thu Oct 25, 2007 7:02 pm

This is still a problem in version 6.2. I hope there are plans to fix this relatively soon; we'd like to put SQL Compare in the hands of all of our devs but this problem is holding it up. Thanks.
Posts: 13
Joined: Thu Jun 28, 2007 12:28 am
Location: San Diego, California, U.S.A.

Still an issue

Postby mattwhetton » Tue Aug 21, 2012 4:18 pm

Is this still an issue - we seem to be getting this problem now, in version 10.2
Posts: 4
Joined: Tue Aug 21, 2012 12:38 pm

Postby kumraldemircan » Wed May 28, 2014 2:49 pm


i have same problem is lastest version but i cant resolve it

Posts: 1
Joined: Wed May 28, 2014 2:43 pm
Location: istanbul

Return to SQL Compare Previous Versions

Who is online

Users browsing this forum: No registered users and 0 guests