Q:

Microsoft SQL Server 2005: Create alias for database

How can I create alias name to my database in SQL Server 2005? 
For example: DB1 and its alias DB2, it's same DB, but with two names.
Or can I do replication, mirroring, syncing or anything other inside server from one DB to another?

A:

You can do replication from one database to another database on the same machine.  You can also copy data directly without having to create an alias.  For instance if you had a table named Users in DB2 and a Users table in DB1 and they are the same schema you could easily just do
INSERT INTO DB1..Users
select * from DB2..Users

Now, a synonym would allow you to use a table from DB2 as if it was a table in DB1 so for instance if you have a table named Products in DB2 you could do
use DB1
GO

CREATE SYNONYM [dbo].[Products] FOR [DB2].[dbo].[Products]
GO

-- Now the following would give you the same result
select * from DB2..Products
select * from Products

For more information on synonyms see here

