Monday, March 19, 2012

Maintain Blank DB Copy

Hi
I have a development database that gets filled with test
data. I would like to maintain a 'blank' copy i.e one
that only contains the data the application needs to run,
that is automatically updated with structural changes,
new SP's etc without any new 'user' data being added to
it.
Can anyone give me any pointers as to the most painless
way of doing this?
Thanks in advance
GrahamI prefer to have the DDL scripts to create the database and then INSERT statements to create the
base stuff, this way you don't have to mess with restore or attach.
Here are some options to generate DDL script, some including data:
You can use SCPTXFER to generate DDL from code as described in:
DTS Does Not Copy Identity, Indexes, Primary Key or Other Constraints (Q220163)
http://www.support.microsoft.com/?id=220163
Generate TSQL scrip with DDL and data:
http://www.rac4sql.net/objectscriptr_main.asp
Generate TSQL script with data:
http://www.sqlscripter.com
Generate TSQL script with data:
http://www.lockwoodtech.com/index.asp?PageId=auto_inserts&TitleID=products
Generate TSQL script with data:
http://www.largosqltools.com/DataInsertScripts.asp
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Graham" <graham@.DONT_SPAM_MEremarkabledesignPLEASE.com> wrote in message
news:0c0f01c3a9e4$680c2590$a401280a@.phx.gbl...
> Hi
> I have a development database that gets filled with test
> data. I would like to maintain a 'blank' copy i.e one
> that only contains the data the application needs to run,
> that is automatically updated with structural changes,
> new SP's etc without any new 'user' data being added to
> it.
> Can anyone give me any pointers as to the most painless
> way of doing this?
> Thanks in advance
> Graham|||Graham wrote:
> Hi
> I have a development database that gets filled with test
> data. I would like to maintain a 'blank' copy i.e one
> that only contains the data the application needs to run,
> that is automatically updated with structural changes,
> new SP's etc without any new 'user' data being added to
> it.
> Can anyone give me any pointers as to the most painless
> way of doing this?
> Thanks in advance
> Graham
Million ways to do this but...
My personal preference would be to create the blank database, dettach
it and make a copy of the dbs data and log files (set them to
readonly). You can then reattach and continue. When you want to go back
to blank you would just detach current db, delete files and copy the
blankcopyones and rename back to origonal names (remove read
attributes) and reattach.
Tibors way is also a very good option.
--
Br,
Mark Broadbent
mcdba , mcse+i
=============

No comments:

Post a Comment