how you can rename a database ?
Interview question and answer by:
Neeks | Posted on: 3/5/2009 | Category:
SQL Server Interview questions | Views: 2311 |
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
Found interesting? Add this to: