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 ?
yes you can do have another DB with different name and that has everything the same .....!!!
www.fadilalnassar.com | FREE Nodil Tab Control
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
Visit my Blog
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.
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
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.