Monday, March 10, 2008

How To Rename The Database In SQL Server

sp_renamedb
Changes the name of a database.

Syntax
sp_renamedb [ @dbname = ] 'old_name' , [ @newname = ] 'new_name'


[@dbname =] 'old_name'
              The current name of the database. old_name is sysname

[@newname =] 'new_name'
             The new name of the database. new_name must follow the rules for identifiers


Example:

CREATE DATABASE xample

sp_renamedb
'xample','Example'


No comments:

Creative Commons License
Disclaimers:We have tried hard to provide accurate information, as a user, you agree that you bear sole responsibility for your own decisions to use any programs, documents, source code, tips, articles or any other information provided on this Blog.