Re: renaming database
From: Hari Prasad (hari_prasad_k_at_hotmail.com)
Date: 07/09/04
- Previous message: Rohtash Kapoor: "Re: renaming database"
- In reply to: dave: "renaming database"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 9 Jul 2004 11:43:35 +0530
Hi,
Follow the below steps to rename a database in SQL server 2000.
1. Remove all the users connected to the database
alter database <dbname> set single_user with rollback immediate
2. Run the below command to rename the database
alter database <current_db_name> modify name=<new_db_name>
3. Set to multi user mode
alter database <dbname> set multi_user
-- Thanks Hari MCDBA "dave" <anonymous@discussions.microsoft.com> wrote in message news:28e1e01c4654c$a8962ab0$a601280a@phx.gbl... > I tried to renaming database using query analyser of sql > server 2000 but I got this error msg. > > Server: Msg 5030, Level 16, State 2, Line 1 > The database could not be exclusively locked to perform > the operation. > > My sysntax was > sp_renamedb 'old_dbname', 'new_dbname' > > How to handle this? what could be the solution? > Thanx > Dave
- Previous message: Rohtash Kapoor: "Re: renaming database"
- In reply to: dave: "renaming database"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|