Renaming a database requires that it be put in single-user mode first.
-- Renaming a database
use master
go
sp_dboption 'warehouse003','single user',true
go
use warehouse003
go
checkpoint
go
use master
go
sp_renamedb 'warehouse003','warehouse009'
go
sp_dboption 'warehouse009','single user',false
go
use warehouse009
go
checkpoint
go
use master
go
sp_helpdb warehouse009
go
|
|