What command do we use to rename a db?

Answers were Sorted based on User's Feedback



What command do we use to rename a db?..

Answer / visala

sp_renamedb 'oldname','newname'

alter database <databasename>
modify name=<newdatabasename>

Is This Answer Correct ?    17 Yes 0 No

What command do we use to rename a db?..

Answer / swetha

sp_renamedb ?oldname? , ?newname?

alter database ?databasename?
modify name = ?newdatabasename?

Is This Answer Correct ?    7 Yes 0 No

What command do we use to rename a db?..

Answer / latha sree

sp_renamedb ?oldname? , ?newname?

Is This Answer Correct ?    7 Yes 1 No

What command do we use to rename a db?..

Answer / karthick.r

sp_rename olddatabasename newdatabasename
for eg
sp_rename prodetails empdetails;


in this eg the name of the prodetails is changed into
empdetails using above command

Is This Answer Correct ?    2 Yes 1 No

What command do we use to rename a db?..

Answer / babuli

To rename a SQL database follow the these seps:

1. Alter database to single user mode. So that all the
active connection will be terminated. (Database properties
-> options > single usermode)
2. Then rename the database using sp_renamedb oldname, newname

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More SQL Server Interview Questions

What is the syntax to execute the sys.dm_db_missing_index_details? : sql server database administration

0 Answers  


How to declare a cursor with "declare ... Cursor" in ms sql server?

0 Answers  


what are triggers? : Sql server database administration

0 Answers  


Can we hide the definition of a stored procedure from a use?

0 Answers  


What are trace files?

0 Answers  






Different Types of Functions ?

2 Answers   Satyam,


Why do you want to join software field as you have done your BE in Electronics?

0 Answers   Cap Gemini, HCL,


Explain Normalization and DE normalization

0 Answers   iNautix,


What are the properties of the transactions?

0 Answers  


What are the results of running this script?

0 Answers  


what number files will a information contain in SQL Server? How many forms of information files exist in SQL Server? How many of those files can exist for a single database?

0 Answers  


Is it possible to create trigger on views?

0 Answers  


Categories