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

How to download and install sql server 2005 books online?

0 Answers  


What are the different types of join?

0 Answers  


how to find the particular row in table?(means suppose one table contain 10 rows , in these 10 rows how to find the particular row(example in 10 rows i want 5 row how)?

16 Answers   Accenture, IBM, Marlabs,


What are the advantages of user defined function?

0 Answers  


What is RAID and what are different types of RAID configurations?

8 Answers   Wipro,






What are the difference between primary keys and foreign keys?

0 Answers  


What are different types of replication in sql server?

0 Answers  


Do you know sql server 2008 introduces automatic auditing?

0 Answers  


Which autogrowth database setting is good?

0 Answers  


What is sql server management studio? : sql server management studio

0 Answers  


How to join two tables in a single query in ms sql server?

0 Answers  


What are acid properties of transaction?

0 Answers  


Categories