dbTalk Databases Forums  

Newbie Structure-Only creation

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Newbie Structure-Only creation in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Zachariah
 
Posts: n/a

Default Newbie Structure-Only creation - 12-23-2003 , 10:46 AM






We have an existing database (dbFoo), with tables full of data. We'd like to create a new database (dbFoo2) with the tables minus the data, i.e. structure but no content. Help!

Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Newbie Structure-Only creation - 12-23-2003 , 10:58 AM






You wouldn't typically use DTS to do this. The way I would do it would be;

1.

Script out the whole of the DB using SQLDMO. Create the the other DB.
Reapply the scripts

2.

Copy the DB (BACKUP/RESTORE). Create scripts to remove the data in DRI
order. Backup the database again and use as a template.


You could also use the Transfer Objects Task and select not to take data
with you.

--
--

Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org

"Zachariah" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
We have an existing database (dbFoo), with tables full of data. We'd like
to create a new database (dbFoo2) with the tables minus the data, i.e.
structure but no content. Help!




Reply With Quote
  #3  
Old   
Zachariah
 
Posts: n/a

Default Re: Newbie Structure-Only creation - 12-23-2003 , 01:21 PM



We were able to do what we needed by doing an export without bringing along the data ... HOWEVER ... we started noticing several queries in our new database that didn't exist in the original database. For example in the original dbFoo database there is no vwRandomFoo. But one shows up after the export to the new dbFooNew database. So we get these phantom views. Any idea why this might happen? Do the system tables keep track of views that were created and deleted and possible re-create them on an export to a new database? Have you ever run into this sort of thing?

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.