Ignore Database Name in Stored Procedures, Views, and Functions
We have 3 environments for one of our core applications. Each environment has a different database name: dbproto, dbuat, and db_live for an example.
We keep all the SP, Views, and Functions we develop in a separate database so at no time do we alter the database supplied by the vendor. This database name is the same in all three environments.
Because of the name difference for the vendor database all the SP, Views, and Functions are flagged as different. The only difference for 95%+ of them have is the database name (eg dbproto vs dbuat).
Could a feature be developed to ignore the database name?
I see it exists in Synonyms but that wouldn't solve our issue as we would have to create a lot of them and change over 1500+ SP, Views, and functions.
Thanks
-
Tony D'Agosta commented
Actually instead of ignoring database name I give a new name (my alias) so that stored procedures with same name in different databases are not confused.
e.g. comparing databases PROD_GENP_Hub vs DEV_GENP_Hub I assign Hub as the alias name for the databases. -
Tony D'Agosta commented
Because of this I stopped using SQL Compare for views and stored procedures and now use my own scripts to do the compare.