How do I customize the name of the shadow database
pkettlew
Posts: 15 Bronze 1
Hello
I have following ShadowConnectionString
<ShadowConnectionString>Data Source=sqlserver-nprd-ted-dev2.database.windows.net;Initial Catalog=sqldb-nprd-ted-dev-$(username)_SHADOW;Pooling=False;Encrypt=False;Authentication=ActiveDirectoryIntegrated;Multi Subnet Failover=False</ShadowConnectionString>
unfortunately it is producing a DB called
sqldb-nprd-ted-dev-$(username)_SHADOW
according to the documentation this should use the environment variable $USERNAME
https://documentation.red-gate.com/sca/developing-databases/concepts/shadow-database?_ga=2.182918694.123694452.1613014504-1216847519.1599029856
How do I use an environment variable in the ShadowConnectionString property of my user profile ?
I have following ShadowConnectionString
<ShadowConnectionString>Data Source=sqlserver-nprd-ted-dev2.database.windows.net;Initial Catalog=sqldb-nprd-ted-dev-$(username)_SHADOW;Pooling=False;Encrypt=False;Authentication=ActiveDirectoryIntegrated;Multi Subnet Failover=False</ShadowConnectionString>
unfortunately it is producing a DB called
sqldb-nprd-ted-dev-$(username)_SHADOW
according to the documentation this should use the environment variable $USERNAME
https://documentation.red-gate.com/sca/developing-databases/concepts/shadow-database?_ga=2.182918694.123694452.1613014504-1216847519.1599029856
How do I use an environment variable in the ShadowConnectionString property of my user profile ?
Tagged:
Answers
We looked into this, and I believe that we had phrased this in the documentation in a confusing way.
I think the following sentence was the source of the confusion:
By default, the shadow database will be created on the same SQL Server Instance as the development database with the name [project]_$(username)_SHADOW.
I have updated the documentation page a bit to try to make how this works more clear. I changed the sentence quoted above to "[project]_[YourUserName]_SHADOW" so that it doesn't resemble an environment variable.
I also reworded a little bit of info below there which may prove useful to you (the second bullet point is new-- we previously had that on a linked page and not here-- and the third is reworded for clarity).
You can change where the shadow database is created by editing the user settings file for your project:
Kendra