October 12, 2007 at 12:10 pm
This wa an oops on my part. I created a new DB las week and I fatfingered the space character in it so now it's called: "DUMMY_FATFINGER " (Notice the space)
Other than recreating it how can I rename it correctly? Just clicking on it to rename it does not work. I get the Database already exists error.
Thanks
October 12, 2007 at 12:18 pm
there s a stored proc just for it; you'll get an error if anyone is connected to it when you try to rename.
sp_renamedb [old name with spaces],[newname]
Lowell
October 12, 2007 at 12:20 pm
From BOL: EXEC sp_renamedb N'Accounting', N'Financial'
October 12, 2007 at 12:27 pm
I get the following error...
Msg 15032, Level 16, State 1, Procedure sp_renamedb, Line 36
The database 'HR_TRACKING' already exists. Specify a unique database name.
Obviously SQL knows the correct name, users are connecting to the correct name that does not have the space at the end. The problem is, when the backup job runs, it is getting the name with the space at the end. When I run the sp_renameDB the system knows already it has the correct name hence the error message above. It's a cosmeting naming thing somewhere in SQL.
Thanks
October 12, 2007 at 12:38 pm
just be sneaky and rename it twice then...that should fix it:
sp_renamedb [HR_TRACKING ],[HR_TRACKINGTMP]
sp_renamedb [HR_TRACKINGTMP],[HR_TRACKING]
Lowell
October 12, 2007 at 12:42 pm
BINGO!!!!
Renaming it twice did the trick!
I actually used the GUI to do it.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply