Tutorials Forums
     Tutorials Videos
        Sign Up Now For FREE
Welcome, Guest
Username Password: Remember me

Renaming a Database
(1 viewing) (1) Guest
SQL SERVER HELP, SQL SERVER TUTORIALS, SQL SERVER PROGRAMMING, SQL SERVER CODE


SQL Server is a relational DMBS written for the Windows platform by Microsoft. SQL Server is a high-end and high-performance solution, for applications that interact with a database. Its use has been increasing because of the number of web applications that feature a data base back end.
  • Page:
  • 1

TOPIC: Renaming a Database

Renaming a Database 04 Feb 2010 14:04 #254

To change the name of a database, Transact-SQL provides sp_renamedb. The formula used would be:
EXEC sp_renamedb 'ExistingName', 'NewName'


The EXEC sp_renamedb expression is required.

The ExistingName factor is the name of the database that you want to rename.

The NewName factor is the name you want the database to have after renaming it.

Here is an example of renaming a database:

EXEC sp_renamedb 'RentalCars', 'BethesdaCarRental
GO
  • CE
  • OFFLINE
  • Administrator
  • Posts: 197
  • Karma: 78
CodersEngine

Re: Renaming a Database 06 Sep 2010 10:58 #388

In SQL Server, you can change the name of a database. Before you rename a database, you should make sure that no one is using the database and that the database is set to single-user mode. The name of the database can include any characters that follow the rules for identifiers.

To Rename a Database

ALTER DATABASE (Transact-SQL)

How to: Rename a Database (SQL Server Management Studio)

_________________________________________________________________



Want to get-on Google's first page and loads of traffic to your website? Hire a SEO specialist from Ocean Groups seo specialist
  • chrisadam
  • OFFLINE
  • CE Newbie
  • Posts: 2
  • Karma: 0
  • Page:
  • 1
Time to create page: 0.46 seconds