Well sometimes sp_reanmedb may not work you know because if
some one is using the db it will not accept this command so
what do you think you can do in such cases?

Answers were Sorted based on User's Feedback



Well sometimes sp_reanmedb may not work you know because if some one is using the db it will not ac..

Answer / kumar

In This case you take following action

1. Alter DataBase <dbname> set single_user with rollback
immediate

2. Sp_renamedb 'olddb','newdb'

3. Alter DataBase <dbname> set multi_user

By
Kumar.T

Is This Answer Correct ?    3 Yes 0 No

Well sometimes sp_reanmedb may not work you know because if some one is using the db it will not ac..

Answer / guest

In such cases we can first bring to db to single user using
sp_dboptions and then we can rename that db and then we can
rerun the sp_dboptions command to remove the single user mode.

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More SQL Server Interview Questions

What are the filtered indexes?

0 Answers  


Explain full-text query in sql server?

0 Answers  


Your table has a large character field there are queries that use this field in their search clause what should you do?

0 Answers  


If user is owning any SQL Objects, can we drop that user

0 Answers  


How to get a list of columns in a view using "sys.columns" in ms sql server?

0 Answers  


What is the partitioning method?

0 Answers  


in tabase table having a column in it empname field is there which having 5 duplicate values is there i want deleted all the duplicates i want showing only one name only.

7 Answers  


Explain differentiate between a having clause and a where clause?

0 Answers  


What does it mean to normalize a database and why would you do it?

0 Answers  


how can u select the Distinct values in the table, table having 20 columns , i want all columns

2 Answers  


How and why use sql server?

0 Answers  


What is the difference between char, varchar and nvarchar?

0 Answers  


Categories