Copy DB tables and stored procedures to a new DB with different name

Hello all!

What I need to do is take a site that I have and make 3 copies of it so I will have 4 separate sites with 4 separate DB's but running on the same server. One of the sites is complete but what I need to know is how do I make a complete copy of the DB including all stored procedures and populate a blank DB that has a different name with contents from the master DB???

So if DB1 is complete and I want to now populate DB2, DB3 and DB4 with everything from DB1 (tables, stored procedures, data etc.) what would be the best way to do this?

The new sites are already setup in IIS and I have already transferred the files to each sites root, so all that is left is to setup the new DB's. They are all running on the same server… I think that is about everything someone would need to know to help me!

Any help would be greatly appreciated!!!

2/14/2006 8:08:49 PM 29906 articles. 0 followers. Follow

3 Replies

Similar Articles

[PageSpeed] 21


1) Create empty dbs


2) Right click on db1 and select Generate SQL script

3) Generate the script for tables,sp,views.....

4) Open your query analyzer

Now, you have to do the following for each db

Use db2
-paste the sql script you did generate in step 3

Run it

Repeat step 4 for all your db.

Hope that helps


ASP.NET Hosting (HostingFest)
2/14/2006 11:30:18 PM

That is easy use the Backup and Restore wizard use the restore from device option it will ask you for a new name just add the name and you will be done in a few minutes.  Known issues orphaned permissions just delete the restore and create a new one.  If you have more questions post again.  Hope this helps.

Kind regards,
Gift Peddie
2/15/2006 12:26:58 PM


Is there another way so I can copy tables and procedures to a new DB , without any manual thing "by coding??"

Thank you

Please remember to "Mark As Answer" if this post answered your question!

Bilal Shouman - MCAD.NET

|My Blog|

9/25/2006 3:33:40 AM

Similar Artilces:

copying data from 1 db stored procedure to another db table
my problem is i have a stored procedure stored in one db ,the stored procedure is basically a select statement..i want to store the result in a table in my own db which is stored in my db...and i want it to be updated on a regular basis..say 5 minutes interval.. independently of the running application..please help ok i made a mistake i wanted to say i want the resultant grid to be stored in another table on the database found on my pc,,,the first database is located on a server..thanks in advance If I understand your first question correctly, you may try to use SELECT INTO syntax http:...

help creating a procedure that iterates thru all my stored procedures and copies them to new stored procedures with new names
I have this sql DB and I want to clone it in a way. I want to run a second web site off the same SQL database. So all my tables and stores procedures currently aare named with a 3 letter prefix that identifies the application. I need to clone all the stored procedures and give them a new name basicly changing the 3 letter prefix to another one. Also if that procedure could once it has a stored procedure open, replace all the 3 letter prefix (of the table names) inside the stored procedure definition itself.  I know I could do all this manualy but there are over 400 stored procedures a...

Copy stored procedures from 1 DB to another DB
I need to copy the stored procedures from a database on one server to another. I used 121 WAM to copy the DB tables over but don't know how to copy the stored procedures over. Can someone point me in the right direction? Ultimately, what I would like to do is have the 2nd server update from the 1st server so I can set up a redundant DB. Thank you for your help in advance. JoelDon't miss the forest for the trees Use DTS and "Copy Objects". In Enterprise Manager, right-click on the database, in All Options, find Export.Starting with ASP.NET 2.0? Look at:Programming...

SQL Server DB Restore to Different DB Name
Hi, I always do a full backup of my database named "LMS". Lets say now i want to have another database (new DB name is LMS1) that have exactly the same content as LMS. I tried to use "Restore database" option but it seems to give me this error: "You are attempting to overwrite an existing database. Check the force restore over existing database option to overwrite the existing database." Then i go to check the force restore option but it give me another error: "The file 'c:\program files\microsoft sql server\mssql\data\LMS_Data.MDF' cannot...

Copy tables from SQL to new Access DB
Anyone out there have an easy way to copy entire tables from SQL to an Access DB? The obvious answer to this is DTS, but I've run into a problem using DTS in a hosted environment that I just cannot overcome, not to mention all the hoops you have to jump through with DTS (such as it doesn't support FTP PUTS!!!!) I was thinking there has got to be a way to use the DataTable.Add(DataTable.Copy()), but can't seem to get things together with this.Rob Okay, I'm getting closer to the solution here. Anyone care to check out this code and tell me why the dataadapter...

Make a copy of SQL DB and update/change stored procedures
Can I make a copy of my development database DEV on same SQL SERVER machine, rename it to TEST and stored procedures to be updated automatically for statements likeUPDATE [DEV].[dbo].[Company]SET [company_name] = @company_nameto becomeUPDATE [TEST].[dbo].[Company]SET [company_name] = @company_namein order not to edit each individual stored procedure for updating it ? Hi Chris,You would have to use SQL Query Analyzer.USE testGOCREATE PROCREDURE p_company_update@company_id INT,@company_name VARCHAR(64)ASSET NOCOUNT ONUPDATE companySET company_name = @company_nameWHERE company_id = @comp...

Transfering tables and data from one MS SQL DB to another MS SQL DB
I need to transfer tables and data from one SQL DB to another SQL DB. I know it can be done with Server Management Studio and I have searched Studio and Help but can't find any info on the database migration wizard. Hi,jayd  Follow This Link U can Get Help From This For Ur Case   PLZ MARK AS ANSWER IF IT HELP U. THANKS. RAGHAV MVP ASP/ASP.Net Read My Blog MARK THE POST AS ANSWER IF IT HELPS U. "Success doesn't come to you…you go to it."--Marva Collins "Success does not come to those who w...

Hi ya all, I had a really quick question. I have created a new table using Sybase Central and have populated it using INSERT statements via ISQL. Everything works beautifully! I originally created this table in our TEST DB. Is there an easy way for me to export or transport it to our LIVE DB without rebuilding the table in LIVE and repopulating the table in LIVE via the INSERT statements? I guess what I'm trying to ask is that once a table has been created in a TEST DB is there some fancy export command which will copy its data type, columns, and values to the LIVE DB? Could you ge...

stored procedure in SQL DB?
I defined a stored procedure in SQL DB, which has two parameters: parm1 in, parm2 output, parm2 is a cursor, and i want use this stored procedure to create a datawindow, but when i preview this datawindow in PB, it always popup messagebox to let me input parm2, and the system set the default data type of parm2 is number, and i did not find the place to define parm2's datatype as cursor, maybe my method is error, who can tell me: how should i do to correctly create the stored procedure and datawindow ? Thanks a lot. 04/07/2002 Which DBMS are you using? There may be s...

Copy data from table in one DB to another DB
Hello all. From within a PB8 application I am trying to copy a select number of rows from an ASA8 database table to a SQL Server 2000 database table. I am having some difficulty with this since: 1. The table name is not known at the time the application is compiled. (without going into lots of detail, I can say that temporary tables are created in the ASA8 database and the SQL Server database by the user, using another product) The source and destination tables are structuraly identical. 2. The source table always has a Long Binary column in i...

Combine tables from previous db to new db (uhh...?)
I'm wanting to migrate an existing customer's database into a new products db. The previous contractor used seperate tables for each product type, where I chose to use one "products" table. My challenge has been that the previous db uses attributes that aren't common across all products. Would it be best to do a products_attribute table? If so, how would I query the previous products db and seperate the information during an insert between "product A" and "product A attributes"? Sample existing table: ID, Name, Price, Weight, Attr1, Attr2, Attr3, Attr4,...

how to import store procedures from DB AAA to DB BBB?
I wrote about 50 store procedures in database AAA of SQL server. Now, database BBB need all these sp, how to import store procedures from AAA to BBB? you can use DTS Import/Export wizard and transfer selective objects... hth***********************Dinakar NethiLife is short. Enjoy it.*********************** It works well. Thank you. Is it possible to use script ? Better. They have tools that do this, including one (in beta now) that generates and assembly recreating the database for you.Thomas TomiczekPowerNodes ApS(Microsoft MVP C#/.NET)---Building a We...

How to copy sql express tables & stored procedures into remote full sql server 2005
Hi all, I am using Visual web developper 2005 with sql server express 2005 and i have also sql server management studio express. it's all free now . my web site is ready I didn't have problem to upload my site to my hoster. Now I want to upload all my tables and my stored procedure create locally with VWD express How can i do it ? NB: I know i can't design DB (create/modify tables and stored proc) with express edition thank's for your help Hi all, I have my all tables and stored procedures on the remote server and my site is working well but it was very hard to. let me ...

C# method using to create an html table with just the db table name
 I was wondering whether there was a simple way using ADO.NET in C# to have a method that has the following header: public static String viewTable(String tablename) that outputs the data either in: <table> <tr> <th>Headings</th> // Repeat for each column in table </tr> <tr> <td>Values</td> // Repeat for each record (and for each column) in table </tr> </table> OR <table> <tr> // Repeat these 4 lines for each column & display values for the first record <td>Heading...

Web resources about - Copy DB tables and stored procedures to a new DB with different name -

Parliamentary procedure - Wikipedia, the free encyclopedia
... of the House of Commons of the Parliament of the United Kingdom , from which it derives its name. In the United States, parliamentary procedure ...

Procedure is more a snap than a snip
A QUEENSLAND doctor is bidding to set an unusual world record by performing the highest number of vasectomies in one day, with the help of fellow ...

Rushed cosmetic procedures a 'recipe for disaster'
&#8203;When Chanelle O'Hare went searching online for a deal on potential cosmetic procedures, she could not have imagined that what she ended ...

Jetstar procedures under investigation after planes took off too heavy
Jetstar's procedures for calculating the weight of its aircraft are under review by the Australian Transport Safety Bureau after two of its planes ...

Old Lady Lawyer: Uncivil Procedure
What is some of the worst behavior you've witnesses by attorneys?

NFL Announces Changes to Officiating Procedures for Playoffs - Bleacher Report
The NFL formally approved changes to its postseason officiating procedures to allow referees the opportunity to consult Vice President of Officiating ...

We need to reform the culture of law enforcement, not just the procedures
We need to reform the culture of law enforcement, not just the procedures by digby I have a new piece up at Salon this morning about police ...

Will Paul Ryan Make His Mark As Speaker By Instituting Impeachment Procedures Against President Obama ...
Wisconsin Ayn Rand devotee Paul Ryan just started his new job as Speaker of the dysfunctional House Republicans. And he's already headed for ...

Catholic hospital allowed to deny sterilization procedure, judge says
Hospital in California argued that the procedure known as ​tubal ligation would violate its religious freedom

TSA Updates Screening Procedure, Will Mandate Some Passengers Use Full-Body Scanners
... Imaging Technologies, or AIT, in favor of full-body pat-downs by TSA agents. Under the new mandate, not everyone can opt for the pat-down procedure. ...

Resources last updated: 1/16/2016 11:41:11 PM