Results 1 to 8 of 8
  1. #1
    Join Date
    Sep 2004
    Posts
    3

    Unanswered: Restoring Database in TSQL

    Hi. I want to restore a database named Employee Training but when I restore it, I want to name it Training. I know to to restore it in TSQL I type
    "RESTORE DATABASE Employee Training To (name of device). How do I rename it to Training? I'd appreciate any help. Thanks.

  2. #2
    Join Date
    Jan 2004
    Location
    In a large office with bad lighting
    Posts
    1,040

    Post

    Have you looked in BOL (books online)? There is an example under RESTORE DATABASE - How to restore a database with a new name (Transact-SQL) that restores a copy of an existing database to another database with a new name.
    I refer you here because you have to use the with move parameter to rename your physical mdf and ldf (and maybe ndf) files. If you have any more questions after you have read this, ask again.

  3. #3
    Join Date
    Apr 2003
    Location
    Washington DC area
    Posts
    1,770

    Cool Restore Database

    Restore the database first then rename it.

  4. #4
    Join Date
    Jan 2004
    Location
    In a large office with bad lighting
    Posts
    1,040

    Wink

    I think then the question would have been "How do I rename a database?"

  5. #5
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Just give it the New name in the RESTORE command?

    RESTORE myNewDBName ....
    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.

  6. #6
    Join Date
    Jan 2004
    Location
    In a large office with bad lighting
    Posts
    1,040
    Which is true and I referred to in post #2 with the BOL article and example cited, since they will have to move the physical filenames to a new file name for the restored database!

    Lindalog, are you getting anything out of this?

  7. #7
    Join Date
    Sep 2004
    Posts
    3

    Thanks

    Quote Originally Posted by tomh53
    Which is true and I referred to in post #2 with the BOL article and example cited, since they will have to move the physical filenames to a new file name for the restored database!

    Lindalog, are you getting anything out of this?
    I'm getting it, you're right about having to move the physical filenames. Thanks for your help

  8. #8
    Join Date
    Sep 2004
    Posts
    3
    Thanks everybody. Tom53, I went to BOL and found exactly what I needed. Thanks alot. You saved me from hours of frustration. I'm sure that I'll be posting another question soon. Take care.

Posting Permissions

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