database alias

  • Hello,

    My manager mentioned he saw something new to sql 2005 where you can alias a database name, so you use 'productdb' in your application while in fact the database is called 'productdb_2'.

    This will help since we have some replicated database called 'product', when for some reason replication fails, we have to do a snapshot, instead of doing it on the original failed database, we use 'product2', when snapshot finishes, we change the database name in a databaselocation table to the new one. But even though, there are some places in the code that hard code the database name, and sometime we forget to change in all these places. It would be nice to keep using 'product' all the time with a database alias. I know you can rename a database in 2005, but that needs downtime.

    I hope I have made myself clear. Thanks for your help.

    Kathleen

     

     

  • Hi Kathleen,

    I think your manager was referring to synonyms, but I don't believe these can be used for database names. I think they're only used for objects within a database.

    Here's the BOL URL to Synonyms in SQL Server 2005:

    ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/6210e1d5-075f-47e4-ac8d-f84bcf26fbc0.htm

    Jason

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply