July 9, 2010 at 5:00 pm
I am trying to rename the database using below command
ALTER DATABASE TEST3.3_STAGING MODIFY NAME = TEST3_3_STAGING
throwing below error
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near '.3'.
please advice
July 9, 2010 at 5:05 pm
try putting square brackets [] around the database names
---------------------------------------------------------------------
July 9, 2010 at 5:13 pm
Great!
it worked
Thank you very much
July 11, 2010 at 10:35 pm
Hi,
If anybody connected to the database. you cannot rename the database.
First you should kill the all users, afterwards you can rename the database.
Alter database databasename set single_user with rollback immediate
You can executes the abopve query, all the users will kill it.
Afterwards you can use this below query.
sp_renamedb olddatabasename,newdatabasename
With Thanks & Regards
Balaji.G
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply