• SQL-DBA-01 (9/26/2016)


    Hi Experts,

    Wanted to know if there is there any way to have database names aliases in SQL Server?

    For example, there is a database with Name: "database A". Can we give the same database an alias: "database B"?

    Nope, an synonym has to point at an object...something is sys.objects basically, and the Server.database context can be on another serv er,, or in another database, or in the same database.

    so there's no partial object name masks like you were hoping for to help with portablilty.

    you could make a procedure that modifies synonym definitions, which might get you close to what you are after.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!