all groups > sql server new users > may 2005 >
You're in the

sql server new users

group:

Newbie : How to rename Database.


Re: Newbie : How to rename Database. Gert E.R. Drapers
5/28/2005 12:00:00 AM
sql server new users:
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.

[quoted text, click to view]

Re: Newbie : How to rename Database. Thammarat Charoenchai.
5/28/2005 12:00:00 AM
Thank you very much :D


[quoted text, click to view]

Re: Newbie : How to rename Database. Hari Prasad
5/28/2005 12:00:00 AM
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]

Newbie : How to rename Database. Thammarat Charoenchai.
5/28/2005 12:00:00 AM
Please help me :)

AddThis Social Bookmark Button