Red Gate forums :: View topic - IgnoreConstraintNames to ignore default unnamed constraints
Return to www.red-gate.com RSS Feed Available

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

IgnoreConstraintNames to ignore default unnamed constraints

Search in SQL Compare 10 forum
Post new topic   Reply to topic
Jump to:  
Author Message
bbilow



Joined: 20 Dec 2011
Posts: 2

PostPosted: Tue Feb 07, 2012 4:29 pm    Post subject: IgnoreConstraintNames to ignore default unnamed constraints Reply with quote

Hi, I have several default and unique constraints that were unnamed when they were created. by default SQL Server seems to assign them a hash name which causes conflicts when using sql compare.
I tried using IgnoreConstraintNames within my command line script but that didn't work. SqlCompare shows a difference like the example below.
UQ__cont__F43B3D3 - UQ__cont__42CB6785

Is there a way to force the constraint name to be the same hash name as before?
Back to top
View user's profile Send private message
Michelle Taylor



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

PostPosted: Thu Feb 09, 2012 7:05 pm    Post subject: Reply with quote

You can specify an actual name for the constraint (e.g. 'col1 CONSTRAINT unique_constraint_x UNIQUE' instead of just 'col1 UNIQUE') when creating the constraint, but there's no global way to force SQL Server to change its automatic naming scheme.

IgnoreConstraintNames ought to have ignored constraint names during comparison (i.e. it won't flag the table as different if the only difference is the constraint name), but if there is another difference on the table then it will attempt to synchronize the constraint name when it synchronizes the table.

If you don't care what the constraint name is, this ought to be harmless (as it should also update any references to that constraint with the new name if you've included dependencies).
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