snippetsqlModerate
Is it possible to create an alias or synonym for a database?
Viewed 0 times
createsynonymdatabasepossibleforalias
Problem
Is it possible to create a database alias or synonym? What I am hoping to be able to do is have NewDatabaseName aliased as OldDatabaseName to prevent having to rewrite a ton of code.
Backstory:
I was approached by a client with a ridiculous self-induced problem. They have a third-party application that has a SQL server back-end. The users have been writing custom reports against this database using Visual Basic, with all database connection information hard-coded in their programs.
Recently the third party software renamed their database. Now all the report EXE's are failing.
Oh, they dont' have a lot of the source code either.
I held back my laughter and said I would see what I could do.
Backstory:
I was approached by a client with a ridiculous self-induced problem. They have a third-party application that has a SQL server back-end. The users have been writing custom reports against this database using Visual Basic, with all database connection information hard-coded in their programs.
Recently the third party software renamed their database. Now all the report EXE's are failing.
Oh, they dont' have a lot of the source code either.
I held back my laughter and said I would see what I could do.
Solution
No this isn't possible (Related Feedback Item)
You could create a new database of the original name and fill that with synonyms pointing to all the objects in the renamed database though.
You could create a new database of the original name and fill that with synonyms pointing to all the objects in the renamed database though.
Context
StackExchange Database Administrators Q#9172, answer score: 16
Revisions (0)
No revisions yet.