Red Gate forums :: View topic - Scripts for User Defined Type Changes
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

Scripts for User Defined Type Changes

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



Joined: 23 Jul 2007
Posts: 16

PostPosted: Thu Nov 17, 2011 7:19 pm    Post subject: Scripts for User Defined Type Changes Reply with quote

I made a change to a user defined type that I'm using as a TVP on some stored procedures. Sql Compare is finding the difference in the UDT and trying to do a DROP/CREATE, but it's failing because those Stored Procedures reference it. In this case I feel it should be detecting those SP's need to be dropped/recreated without me checking "Synchronize all dependencies" which I never turn on because I've seen it do unexpected things that I didn't want. If you change something in the PK it's smart enough to deal with the chain of indexes/constraints without that checkbox and this seems like the same situation
Back to top
View user's profile Send private message
Chris Auckland



Joined: 24 Oct 2006
Posts: 755
Location: Red Gate Software Ltd.

PostPosted: Mon Nov 21, 2011 5:05 pm    Post subject: Reply with quote

Thanks for your post.

Indexes/constraints aren't considered objects in their own right in SQL Compare, and are treated as part of the table object. This is probably why their dependencies are taken into account without using the 'include dependencies' option.

When you don't use the 'include dependencies' option, then only the objects selected for synchronization will be considered and any other unselected objects will not be brought back into the project.

Does it pick up the dependency to the stored procedure if you 'include dependencies'?
_________________
Chris
Back to top
View user's profile Send private message Send e-mail
alecl



Joined: 23 Jul 2007
Posts: 16

PostPosted: Tue Nov 22, 2011 2:11 am    Post subject: Reply with quote

"Does it pick up the dependency to the stored procedure if you 'include dependencies'?"

Yes, but I've found that can sometimes add unexpected and dangerous changes to a deploy script so I never include that. I wish I had a good example of why I'm afraid to do that. I came to that conclusion literally years ago and I don't recall what led me to it.

It seems like in a situation where the change script will outright fail and with something as innocuous as just recreating the SP's that this situation should be handled without having to check that checkbox for include dependencies.
Back to top
View user's profile Send private message
Chris Auckland



Joined: 24 Oct 2006
Posts: 755
Location: Red Gate Software Ltd.

PostPosted: Thu Nov 24, 2011 12:56 pm    Post subject: Reply with quote

Sorry for the delay.

The reason for having the option to not include dependencies is basically so users can choose that unselected objects are not brought back into the project under any circumstances.

If you need the tool to help bring any connected objects back into the project, then that's when the 'include dependencies' option should be used. If it's performing dangerous or undesirable actions, then that's the issue we need to look into.

A lot had changed in the tools dependency engine in the last few years, so you might find it reliable now.
_________________
Chris
Back to top
View user's profile Send private message Send e-mail
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