Results 1 to 7 of 7
  1. #1
    Join Date
    May 2004
    Posts
    28

    Unanswered: how to duplicate an entire database

    I have built a template database which I'm finally pleased with, however I want to periodically duplicate the design - not data into a new database. How can I duplicate a database? I was hoping to right mouse, copy, then right mouse, paste, and then be prompted for the new name but no such luck.

  2. #2
    Join Date
    Apr 2004
    Location
    CHENNAI-INDIA
    Posts
    8
    You cannot copy paste a database. You can write a script which copys and pastes the database by accecpting the database name as a parameter

  3. #3
    Join Date
    May 2004
    Posts
    28
    Quote Originally Posted by chandarmohanr
    You cannot copy paste a database.
    yep, I'm very clear on this.

    Quote Originally Posted by chandarmohanr
    You can write a script which copys and pastes the database by accecpting the database name as a parameter
    Sorry for being so rash, but had I known how to write the script I wouldn't have posted my message. You might as well have answered with the single word "yes" as this would have been just as helpful.

    example..........please.

  4. #4
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    Check this out, it may lead you in the right direction:

    "C:\Program Files\Microsoft SQL Server\MSSQL\Upgrade\scptxfr.exe" /s <SERVER_NAME> /I /d pubs /r /f C:\test.sql
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

  5. #5
    Join Date
    Jun 2003
    Posts
    11
    in enterprise manager click tools (i think, I am at home no enterprise manager here) then Generate SQL Script it will pop a wizard that will walk you through generating a complete script of the database.

    hope that helps

    Tal McMahon

  6. #6
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    And how is this better than using a native tool that would do everything for you?
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

  7. #7
    Join Date
    Apr 2004
    Location
    Kansas City, MO
    Posts
    734
    The scripts that EM generate are junk if you have any kind of relational integrity, unless of course you want to spend hours looking through it and straightening it out so it will actually work. I would look at the tool that rdjabarov pointed out.

    If you have Visio, you could also easily reverse engineer the database, then create a new one from the data model. You would then have a nifty little Visio diagram for your database.
    MeanOldDBA
    derrickleggett@hotmail.com
    When life gives you a lemon, fire the DBA.

Posting Permissions

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