Red Gate forums :: View topic - CHECK constraint dependencies upon user-defined functions?
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Compare Previous Versions
SQL Compare Previous Versions forum

CHECK constraint dependencies upon user-defined functions?

Search in SQL Compare Previous Versions forum
Post new topic   Reply to topic
Jump to:  
Author Message
jalbert



Joined: 28 Jun 2007
Posts: 13
Location: San Diego, California, U.S.A.

PostPosted: Thu Aug 02, 2007 7:53 pm    Post subject: CHECK constraint dependencies upon user-defined functions? Reply with quote

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?
Back to top
View user's profile Send private message
Michelle Taylor



Joined: 30 Oct 2006
Posts: 529
Location: Red Gate Software

PostPosted: Fri Aug 03, 2007 4:47 pm    Post subject: Reply with quote

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.)
Back to top
View user's profile Send private message
jalbert



Joined: 28 Jun 2007
Posts: 13
Location: San Diego, California, U.S.A.

PostPosted: Thu Oct 25, 2007 8:02 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
mattwhetton



Joined: 21 Aug 2012
Posts: 4

PostPosted: Tue Aug 21, 2012 5:18 pm    Post subject: Still an issue Reply with quote

Is this still an issue - we seem to be getting this problem now, in version 10.2
Back to top
View user's profile Send private message
kumraldemircan



Joined: 28 May 2014
Posts: 1
Location: istanbul

PostPosted: Wed May 28, 2014 3:49 pm    Post subject: Reply with quote

hi

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

thanks
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group