Tuesday, March 20, 2012

rename a database

Hi,
How do I rename a database without changing the users permissions?
I have tried
ALTER DATABASE old_db_name
MODIFY NAME = new_db_name
and
EXEC sp_renamedb 'old_db_name','new_db_name'
and both give me:
Server: Msg 5030, Level 16, State 2, Line 1
The database could not be exclusively locked to perform the operation.
Thanks
// MalinMake sure that Old_db is not used by other resources at the time of
rename
Madhivanan

No comments:

Post a Comment