Can I Rename A DB?

  • I'm running MS SQL 7.0 and I want to rename a database.  Is that possible?  I have a feeling I can't and that I'm just going to have to somehow export the DB and import it as a new DB.  I tried using DTS to export the data but I had a failure importing the "dtproperties" table (I think it said something about not being able to copy a BLOB field).

    Maybe DTS simply isn't the correct way to do this though.  Am I heading down the right path?  If not, can someone point me in the right direction?  Thanks in advance,

    Kevin

    By the way, does anyone know how to turn off all the annoying smiley faces that appear in my editor window when I'm creating a new message?

     

  • use sp_renamedb from query analyzer

    make sure no one is in the database when you do this

     

     

  • I believe you must put the db in single user mode before attempting sp_renamedb.

    exec sp_dboption dbname, 'single user', true

    See BOL.

  • what about deattaching the db .. and then attaching it (from query analyzer) and supply a new name in your code ?


    Alamir Mohamed
    Alamir_mohamed@yahoo.com

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply