Hi,
For renaming the database you could use the ALTER DATABASE COMMAND.
alter database DB_NAME modify name = new_db_name
Before renaming change the database to Single user mode
Alter database <dbname> set SINGLE_USER with ROLLBACK IMMEDIATE
Now rename the database
AFTER renaming change the database to Multi_user mode
ALTER database <NEW_DBNAME> set MULTI_USER
Thanks
Hari
SQL Server MVP
[quoted text, click to view] "Thammarat Charoenchai." <apatiu@ubononline.com> wrote in message
news:uMQxsa4YFHA.1368@tk2msftngp13.phx.gbl...
> Thank you very much :D
>
>
> "Gert E.R. Drapers" <GertD@SQLDevNet> wrote in message
> news:OAa9yK4YFHA.2828@TK2MSFTNGP10.phx.gbl...
>> See sp_renamedb
>>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_sp_ra-rz_3yle.asp
>>
>> GertD@SQLDev.Net
>>
>> Please reply only to the newsgroups.
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>> You assume all risk for your use.
>> Copyright © SQLDev.Net 1991-2005 All rights reserved.
>>
>> "Thammarat Charoenchai." <apatiu@ubononline.com> wrote in message
>> news:%23rl5Sq3YFHA.4024@TK2MSFTNGP10.phx.gbl...
>>> Please help me :)
>>>
>>
>>
>
>