Monday, June 12, 2006

Rename SQL Server DB through SP

sp_renamedb Changes the name of a database.

Syntaxsp_renamedb [ @dbname = ] 'old_name' , [ @newname = ] 'new_name'
Arguments[@dbname =] 'old_name'

Is the current name of the database. old_name is sysname, with no default.
[@newname =] 'new_name'

Is the new name of the database. new_name must follow the rules for identifiers. new_name is sysname, with no default.

Return Code Values 0 (success) or a nonzero number (failure)

PermissionsOnly members of the sysadmin and dbcreator fixed server roles can execute sp_renamedb.

Examples
EXEC sp_renamedb 'user', 'useraccounts'

This example changes the name of the user database to useraccounts.

1 Comments:

At 1:56 PM, Blogger offabacker said...

Casinos in Dallas, TX
10 Casinos Near Harrah's Hotel and Casino in Dallas, TX. Search for 구미 출장샵 Casinos near 광주 출장안마 Harrah's Hotel 용인 출장샵 and 충주 출장안마 Casino and restaurants 경상남도 출장안마 near Harrah's Hotel and Casino.

 

Post a Comment

<< Home