Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Create Database

Author  Topic 

asuni
Yak Posting Veteran

55 Posts

Posted - 2010-04-21 : 02:11:02
Hi All,

How to create a empty database in sqlserver 2005 using existing database.
I mean i have to create a database from existing database without data. with empty tables only.

Thank you
Suni

keyursoni85
Posting Yak Master

233 Posts

Posted - 2010-04-21 : 02:14:59
For that you can generate sql script from existing db and execute in your new database for clone of existing database.

is there any other requirement then please describe in detail.
Go to Top of Page

asuni
Yak Posting Veteran

55 Posts

Posted - 2010-04-21 : 02:17:36
Thank you very much.
ya, But i need using query. Is it possible?

thanks


Go to Top of Page

keyursoni85
Posting Yak Master

233 Posts

Posted - 2010-04-21 : 02:25:15
Hi

i am not sure about create new database from existing one using a single query but,

you can refer below link for more idea..
http://msdn.microsoft.com/en-us/library/ms186390.aspx
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-04-21 : 02:25:44
You could Backup existing database and Restore to new database and the TRUNCATE or DELETE data in all tables.

But the script method is definitely preferable.
Go to Top of Page

asuni
Yak Posting Veteran

55 Posts

Posted - 2010-04-21 : 02:32:09
ok, thank you very much all.
Go to Top of Page
   

- Advertisement -