Results 1 to 9 of 9
  1. #1
    Join Date
    Oct 2007
    Posts
    35

    Unanswered: 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.

    Thanks

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    sp_rename?
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  3. #3
    Join Date
    Oct 2007
    Posts
    35
    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.

  4. #4
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    sp_renamedb should still work. everyone has to be logged out first though.
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  5. #5
    Join Date
    Oct 2007
    Posts
    35
    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

  6. #6
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Damn I get here BEFORE I get the email

    OR

    You could dump the db and rename it

    Why do you care BTW?
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  7. #7
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    What Backup Job?

    And let me ask this silly question

    does the other bd actually exist?
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  8. #8
    Join Date
    Oct 2007
    Posts
    35
    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

  9. #9
    Join Date
    Oct 2007
    Posts
    35
    BINGO!!!!

    Renaming it twice did the trick!

    I actually used the GUI to do it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •