RENAME DATABASE old_db_name TO new_db_name;  
Rename SQL server database using T-SQL
This command is useful for SQL server 2005, 2008, 2008R2 and 2012.

ALTER DATABASE old_name MODIFY NAME = new_name