currently, I'm doing a bit of a data migration between one db to another based on some business rules.
I have this huge script that I'm writing where I'm referencing both databases a lot of times. The problem is that this data migration is currently in development, at some point I am going to want to have to do it in production with two different databases.
Instead of referencing the database name directly like so
Insert Into Database2.dbo.Table1
Select * from Database1.dbo.Table1
I would like to somehow just reference the database at the start of the script. So that I can just change the one variable when I change databases.
Is that possible?