How to make copy of db
-
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?
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
-
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?
Create a database with new name and export all data of existing database to new one. Saqib
-
Create a database with new name and export all data of existing database to new one. Saqib
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
-
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
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
-
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
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...