Coping Database objects from one database to another blank database.

I want to create a duplicate database   in sql 2000 using asp.net 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 asp.net from webform

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


0
Suprabha
8/18/2005 12:39:06 PM
asp.net.sql-datasource 29906 articles. 0 followers. Follow

5 Replies
888 Views

Similar Articles

[PageSpeed] 7

yes you can do have another DB with different name and that has everything the same .....!!!
Fadil Alnassar
www.fadilalnassar.com | FREE Nodil Tab Control
http://www.mefranchising.com
0
fadil1977
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.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_ba-bz_35ww.asp

Hope this helps


Scott Sargent

Visit my Blog
0
codeboy
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
0
Caddre
8/18/2005 6:42:50 PM
Hello,

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


0
Suprabha
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
0
Caddre
8/19/2005 7:35:02 PM
Reply: