SSDT is a good option, however it will take a while for you and all developers to get used to it and understand what is offline development and state based deployments. You can read how SSDT works by yourself, however there are few advice for you:
- For every database involved into your queries you need to create project
- If you use other database in the code, then this project is supposed to be added as a reference
- Instead of having 3/4 part names in the code (server.database.schema.name or database.schema.name) create synonyms for every single object and in the synonym use variables for the server and database names
- Don't put logins, users and permissions into that project
- Create publish profiles and take a look to all settings carefully (for example exclude users, logins, permissions and so on from deploying)
- There are pre/post scripts where you can create some workarounds
Mostly people afraid of fully automated deployment to PROD using SSDT as the script is generated automatically and there is only very limit control on the final deployment script (to be fair, you can control pretty much everything using deployment contributors, but it is the topic of another discussion). Usually there is script review step between script generation and the deployment.
So, if you'll stick with SSDT the roardmap for you is:
- Create projects for all databases used in the code
- Create synonyms for all the objects in the project that are from other database with variables as the database and instance names (very important point)
- Use replace across multiple files for all the external database and instances
HINT for replacement. There are several combinations of the object names in the code:
- INSTANCE.DATABASE.SCHEMA.OBJECT
- INSTANCE.DATABASE..OBJECT
- INSTANCE...OBJECT
- All other combinations with [] or "", for example [dbo].[SomeTable] or [dbo].SomeTable
So what you can do is to replace INSTANCE with $(InstanceName) across of all files, the [Database] with [$(DatabaseName)] and so on. Be creative and basically when you know what to do you can put pretty much any db to the SSDT in few hours with these tricks.