To rename a database first get the database into Single user mode .
By using the query below ( run these query in query analyzer)
ALTER DATABASE database_name SET SINGLE_USER WITH ROLLBACK IMMEDIATE
then rename the database using following query
SP_RENAMEDB 'old db_name', 'new db_name'
then change the access mode of the database to multiuser mode
ALTER DATABASE new_database_name SET MULTI_USER
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment