How to create and use Alias Name for the Database
-
Hi All, I have a database in Prod as DbX, and its a live database each time we deploy some schema changes on the Database we Post fix the date, which is working good so far. Its good so far, but to not to change the Connection Strings can I alias database with a particular name to keep the Connection String same but inside database they point to the different times different databases according to the newest version. Why we are keeping different versions every time is, if we keep the same name and restore multiple times from local backup then the Server backup we do, the local backup restore is influencing on the Server backup with SQL Safe Backup. So the question is can we have an Alias of the database which points to the different active database for every new release and still can be access from UI with the same Alias name so that UI team doesn't have to change their connection strings for every new release of the database? Any help, a link, a code snippet or even a suggestion would be very very helpful. Thanks in advance.
Thanks, Abdul Aleem "There is already enough hatred in the world lets spread love, compassion and affection."
-
Hi All, I have a database in Prod as DbX, and its a live database each time we deploy some schema changes on the Database we Post fix the date, which is working good so far. Its good so far, but to not to change the Connection Strings can I alias database with a particular name to keep the Connection String same but inside database they point to the different times different databases according to the newest version. Why we are keeping different versions every time is, if we keep the same name and restore multiple times from local backup then the Server backup we do, the local backup restore is influencing on the Server backup with SQL Safe Backup. So the question is can we have an Alias of the database which points to the different active database for every new release and still can be access from UI with the same Alias name so that UI team doesn't have to change their connection strings for every new release of the database? Any help, a link, a code snippet or even a suggestion would be very very helpful. Thanks in advance.
Thanks, Abdul Aleem "There is already enough hatred in the world lets spread love, compassion and affection."
You are doing this completely wrong, do it the same as you would do a branch, leave your latest version with the original name and change your archive database name before deploy a new version. Your production database should never change its connection string.
Never underestimate the power of human stupidity RAH
-
You are doing this completely wrong, do it the same as you would do a branch, leave your latest version with the original name and change your archive database name before deploy a new version. Your production database should never change its connection string.
Never underestimate the power of human stupidity RAH
-
You are doing this completely wrong, do it the same as you would do a branch, leave your latest version with the original name and change your archive database name before deploy a new version. Your production database should never change its connection string.
Never underestimate the power of human stupidity RAH
USE <SYNONYMDB> SELECT '[' + TABLE_NAME + ']', '[' + TABLE_SCHEMA + '].[' + TABLE_NAME + ']', 'IF EXISTS (SELECT * FROM sys.synonyms WHERE name = ''' + TABLE_NAME + ''') DROP SYNONYM ['+ TABLE_NAME + ']; CREATE SYNONYM [' + TABLE_NAME + '] FOR <ORIGINALDB>.' + TABLE_SCHEMA + '.[' + TABLE_NAME + ']' AS SynonymUpdateScript FROM <ORIGINALDB>.INFORMATION_SCHEMA.TABLES ................................. parse migration service
-
USE <SYNONYMDB> SELECT '[' + TABLE_NAME + ']', '[' + TABLE_SCHEMA + '].[' + TABLE_NAME + ']', 'IF EXISTS (SELECT * FROM sys.synonyms WHERE name = ''' + TABLE_NAME + ''') DROP SYNONYM ['+ TABLE_NAME + ']; CREATE SYNONYM [' + TABLE_NAME + '] FOR <ORIGINALDB>.' + TABLE_SCHEMA + '.[' + TABLE_NAME + ']' AS SynonymUpdateScript FROM <ORIGINALDB>.INFORMATION_SCHEMA.TABLES ................................. parse migration service
And you are telling me this for a reason!!! Also while the answer is technically correct it is the wrong solution, the archives need to be changed but the production database.
Never underestimate the power of human stupidity RAH
-
And you are telling me this for a reason!!! Also while the answer is technically correct it is the wrong solution, the archives need to be changed but the production database.
Never underestimate the power of human stupidity RAH
Notice the site-driving spam link at the bottom of the message. :doh:
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer