Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2004
    Posts
    134

    Unanswered: Renaming SQL Server 2000 Database?

    This is a cross posting with:
    http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=33143

    Is it possible to rename a database in SQL Server 2000? If
    not, is it possible to copy the tables and relationship diagram
    from one to another? The database is new, so there are no records
    to copy. I just want to rename it, because redoing the tables would
    take too much energy (<----Lazy).

    Mike B

  2. #2
    Join Date
    Oct 2001
    Location
    Naples, FL
    Posts
    273
    sp_renamedb - see BOL for details
    ---------------
    Ray Higdon MCSE, MCDBA, CCNA

  3. #3
    Join Date
    Feb 2004
    Posts
    134
    Originally posted by rhigdon
    sp_renamedb - see BOL for details
    Thanks, that is what I wanted but I am new to SQL Server. Where do I enter this? Not the query analyzer because there you have to select a database to execute the procedure on? This would be executing a procedure on the system right?

    Code:
    EXEC sp_rename 'Inform', 'TPGSystem'
    I tried the above in the query analyzer in using both the 'Inform' and 'Master' databases and get errors.

    When using the master databse I got the following error:
    No item by the name of 'Inform' could be found in the current database 'master', given that @itemtype was input as '(null)'.


    Any help?

    Mike B

  4. #4
    Join Date
    Oct 2001
    Location
    Naples, FL
    Posts
    273
    In QA run this

    EXEC sp_renamedb 'olddbname', 'newdbname'
    ---------------
    Ray Higdon MCSE, MCDBA, CCNA

  5. #5
    Join Date
    Feb 2004
    Posts
    134

    Thumbs up

    lol, sp_renamedb not sp_rename. duh!!!! such an idiot sometimes!

    Thanks
    Mike B

  6. #6
    Join Date
    Oct 2001
    Location
    Naples, FL
    Posts
    273
    Happens to the best of us, glad I could help
    ---------------
    Ray Higdon MCSE, MCDBA, CCNA

Posting Permissions

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