Script linked server names
Imagine we have a complex database which uses a lot of other databases via linked servers. Now imagine it's a dev environment, we put this complex database into SVC and do development.
The problem begins when we're about to release to a prod environment via RedGate Compare, prod environment has all required linked servers and foreign database with they all come with different names. The inability to use variables inside RedGate makes it difficult to script linked servers and foreign database names. Ideally it could be something like VS Database for Professionals + SQLCMD
-
ptrubs commented
You could also manage linked servers via synonyms, which gives your procs/views the same code in all environments, and you can manage your synonyms outside the deployment process
(but sqlcmd would make a LOT of other use cases much simpler)
-
Alex Lukashov commented
Why would it be an evironment problem?=)))
It kinda normal to isolate envrironments from each other so dev database uses dev version of linked servers and foreign databases.
We have a DB which uses dozens linked servers and even more foreign DBs, we have a lot of consultants which helps us on dev environment and we don't want them to see prod data thus we must isolate environments from each other.
Example that you described works for simple systems but not in our case unfortunately. -
Pete Cousins commented
I don't think this is a Redgate problem - it's an environment problem. I have 3 servers, dev-sql-db02, mo-sql-db02 & rias-sql-db02. Development, test and live versions of the same server. On other servers, I have linked servers to all these machines called SQL-DB02. In a dev environment this links to DEV-SQL-DB02, on test to MO-SQL-DB02 etc. As code moves from dev to test to production, there's no need to change it, as the SQL-DB02 linked server points to the appropriate server.