Ignore Database Name in Stored procedures, functions, views.

Forum for users of SQL Compare schema synchronization utility

Ignore Database Name in Stored procedures, functions, views.

Postby MikeInOr » Thu Apr 26, 2012 12:23 am

I see there is an option to ignore database names in synonyms. Is there any chance of having an option to ignore database names in stored procedures, user defined functions and views?

Background: We scaled out out database arcitecture when we ran into the wall in scaling up. Our scale out strategy involved migrating to multiple SQL servers with subscripted names... i.e. SQL001, SQL002, SQL003... etc.

Each of these servers has multiple databases that are also subscripted... i.e. On SQL001 there are databases dbA001, dbB001, dbC001, etc.
On SQL002 there are databases dbA002, dbB002, dbC002, etc
(This allows us to move customers back and forth between servers and run multiple database sets on a single server).

Several of our existing stored procedures, views and udf's use three part naming to reference across databases... i.e.
Select * from dbA001.dbo.TableX Join dbC001.dbo.TableY

We would like an option to ignore the database name in a 3 part name when comparing these databases. It there any way to accomplish this or is there a chance such functionality might be added? We are currently managing this comparison and deployment with in house code but wopuld love to dump our inhouse code and purchase your tools instead. I understand the proper way to accomplish this is with synonyms BUT I have been over ruled by my boss about implementing synonyms.

Thank you,
Posts: 1
Joined: Thu Apr 26, 2012 12:06 am

Postby eddie davis » Mon Apr 30, 2012 12:41 pm

Thank you for post into the forum.

I am little confused with the contents of your post.

If you are refering to the full qualification of objects name inside the Stored Procedure Code or Function or View, I suspect the answer will be no.

SQL Compare will not rewrite the code for you. The purpose of SQL Compare is to generate a set of results that show you the differences between objects in each data source and provide a mechanism for deployment or synchronization to make the objects in each data source identical.

If this is a feature that you wish to be added, I recommend that you post on the Red Gate Uservoice Forum using this LINK.

Many Thanks
Eddie Davis
Technical Support Engineer
Red Gate Software Ltd
E-mail: support@red-gate.com
eddie davis
Posts: 1149
Joined: Wed Jun 14, 2006 2:47 pm
Location: Red Gate Software

Return to SQL Compare Previous Versions

Who is online

Users browsing this forum: No registered users and 0 guests