Coping Database objects from one database to another blank database.

I want to create a duplicate database   in sql 2000 using from a webform
I created a database using CREATE DATABASE .......

But how to copy tables, views, stored procedures to newly created
database from old using from webform

Is there any another method to create a duplicate database with another name
from existing database on same server ?

8/18/2005 12:39:06 PM 29906 articles. 0 followers. Follow

5 Replies

Similar Articles

[PageSpeed] 45
Get it on Google Play
Get it on Apple App Store

yes you can do have another DB with different name and that has everything the same .....!!!
Fadil Alnassar | FREE Nodil Tab Control
8/18/2005 5:19:15 PM
One way it can be done is with the backup database command.  You can backup a database, create a new database and then restore the backup to the new database.  This can all be done in batch scripts and with T-SQL.  Take a look at this link on MSDN, also look at the RESTORE links down at the bottom.

Hope this helps

Scott Sargent

Visit my Blog
8/18/2005 5:55:41 PM

The easiest is to use the Restore option of the Backup and Restore wizard, choose the restore from a Device option click on the wizard to locate your .bak file and SQL Server will ask you for a name for the new version.  If the restore is not successfull delete it and start again.  Hope this helps.

Kind regards,
Gift Peddie
8/18/2005 6:42:50 PM

I have project of a company having 15 branches allover.

I want to create a seperate database for each branch.

When a customer register a new branch new database should be created.

Thank for the reply

8/19/2005 3:57:35 AM

If you are just creating Databases all you need are fifteen connection strings in your Web.config by creating new app setting section for each database.  If you need the databases in separate servers  you have to register all servers in your SQL Server and create the databases.  When you are connecting to SQL Server you are accessing none .NET managed resource so I think you should plan and test all options and your users creating databases on login should not be one of them.  Hope this helps.

Kind regards,
Gift Peddie
8/19/2005 7:35:02 PM