Monday, March 12, 2012

FAT Fingered my DB name with a space character...

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.

Thankssp_rename?|||I forgot to mention it is on a SQL 2005 Server. Is sp_rename SQL 2005? I recall, I think I recall, sp_renamedb was SQL 2K?

Thanks for the quick reply.|||sp_renamedb should still work. everyone has to be logged out first though.|||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|||Damn I get here BEFORE I get the email

OR

You could dump the db and rename it

Why do you care BTW?|||What Backup Job?

And let me ask this silly question

does the other bd actually exist?|||I care becaus when the backups kick off to backup to a disk device to a file, the filename to backup to comes out to be 'DBNAME_FATFINGER _backup_200710120945.bak'. It can't handle the space in the name and the backup job errors out.

Thanks|||BINGO!!!!

Renaming it twice did the trick!

I actually used the GUI to do it.

No comments:

Post a Comment