Answer:
o rename a database first get the database into Single user mode . by using the query below ( run these query in query analyzer)
ALTER DATABASE DBMydb SET SINGLE_USER WITH ROLLBACK IMMEDIATE
then rename the database using sp_rename
sp_renamedb 'DBMydb', 'DBmydb_new'
then change the access mode of the database to multiuser
ALTER DATABASE DBmydb_new SET MULTI_USER
Asked In: Many Interviews |
Alert Moderator