Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. How to make copy of db

How to make copy of db

Scheduled Pinned Locked Moved Database
databasequestiontutorial
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    leckey 0
    wrote on last edited by
    #1

    I am working on a project and to test I would like to make a copy of the SQL database just so I don't mess up the original data. How can I do this?

    C S 2 Replies Last reply
    0
    • L leckey 0

      I am working on a project and to test I would like to make a copy of the SQL database just so I don't mess up the original data. How can I do this?

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      Do a complete backup of the database then restore it with a different name.


      "On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question." --Charles Babbage (1791-1871) My: Website | Blog

      1 Reply Last reply
      0
      • L leckey 0

        I am working on a project and to test I would like to make a copy of the SQL database just so I don't mess up the original data. How can I do this?

        S Offline
        S Offline
        Saqib Mehmood
        wrote on last edited by
        #3

        Create a database with new name and export all data of existing database to new one. Saqib

        C 1 Reply Last reply
        0
        • S Saqib Mehmood

          Create a database with new name and export all data of existing database to new one. Saqib

          C Offline
          C Offline
          Colin Angus Mackay
          wrote on last edited by
          #4

          But if you do that you don't get the stored procedures, UDFs, users, etc. In other words, it is not a copy of the database, it is just a copy of the data.


          "On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question." --Charles Babbage (1791-1871) My: Website | Blog

          S 1 Reply Last reply
          0
          • C Colin Angus Mackay

            But if you do that you don't get the stored procedures, UDFs, users, etc. In other words, it is not a copy of the database, it is just a copy of the data.


            "On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question." --Charles Babbage (1791-1871) My: Website | Blog

            S Offline
            S Offline
            Saqib Mehmood
            wrote on last edited by
            #5

            get backup of existing database, create new database and restore that backup to new created database, this would now contain all things in it. Saqib

            F 1 Reply Last reply
            0
            • S Saqib Mehmood

              get backup of existing database, create new database and restore that backup to new created database, this would now contain all things in it. Saqib

              F Offline
              F Offline
              furher
              wrote on last edited by
              #6

              the best thing what i suggest is , right click on the database for ehich u need a copy .. then generate the sql script then follow the steps like showall->scriptall..then u find it will create a file with all sql statements...after that u do.. 1. copy the complete sql statments to query analyzer...and in first line give the command create database (new database name ) ...copy all the sql statements then execute ( i mean f5) that's it every problem has a solution...

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups