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

Is it possible to have more then one foreign key in a single table? if possible, is this the good way to design the table?

2 Answers  


How do I trace a query in sql server?

0 Answers  


How to test values returned by a subquery with the in operator?

0 Answers  


Explain the architecture of SQL Server?

2 Answers   ABC, HP, Oracle,


Can a stored procedure call itself or recursive stored procedure? How many levels sp nesting is possible?

0 Answers  






What's the maximum size of a row?

4 Answers   IBM,


What is database dimension? : sql server analysis services, ssas

0 Answers  


What are the pros and cons of creating extended stored procedures?

1 Answers  


What is the exact numeric data type in sql?

0 Answers  


1. SELECT SUM(sal) as “Gross Salary” from EMPLOYEES; 2. SELECT MAX(sal) as “Highest Salary” from EMPLOYEES; ouput should be in table format

2 Answers  


How to delete particular value in the column of a table.Is it possible or not?if possible give it as in query.

8 Answers   Intelenet,


how would you troubleshoot blocking? : Sql server database administration

0 Answers  


Categories