Creating Test Database

I need to create a test database on the live server for performance testing.
From time to time, as structural modifications are made to the live
database, I'd like to be able to delete the test database and replace it
with a new copy of the live database. Is there a simple way to do this with
a script or other? Thanks!
DM McGowan II [ Di, 13 November 2007 07:34 ] [ ID #1869323 ]

Re: Creating Test Database

I'd go for backup and restore. When you do the restore, specify a different database name and use
the MOVE option of the RESTORE command to specify new database file names.

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi


"Neil" <nospam [at] nospam.net> wrote in message news:EAb_i.20588$Pv2.7236 [at] newssvr23.news.prodigy.net...
>I need to create a test database on the live server for performance testing. From time to time, as
>structural modifications are made to the live database, I'd like to be able to delete the test
>database and replace it with a new copy of the live database. Is there a simple way to do this with
>a script or other? Thanks!
>
Tibor Karaszi [ Di, 13 November 2007 08:31 ] [ ID #1869324 ]

Re: Creating Test Database

And if there's an existing db with that name, it will overwrite it entirely?

"Tibor Karaszi" <tibor_please.no.email_karaszi [at] hotmail.nomail.com> wrote in
message news:F4D3C4C1-35C2-4CFE-81C0-A7AF434911AA [at] microsoft.com...
> I'd go for backup and restore. When you do the restore, specify a
> different database name and use the MOVE option of the RESTORE command to
> specify new database file names.
>
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
>
> "Neil" <nospam [at] nospam.net> wrote in message
> news:EAb_i.20588$Pv2.7236 [at] newssvr23.news.prodigy.net...
>>I need to create a test database on the live server for performance
>>testing. From time to time, as structural modifications are made to the
>>live database, I'd like to be able to delete the test database and replace
>>it with a new copy of the live database. Is there a simple way to do this
>>with a script or other? Thanks!
>>
>
DM McGowan II [ Di, 13 November 2007 21:39 ] [ ID #1869331 ]

Re: Creating Test Database

Neil (nospam [at] nospam.net) writes:
> And if there's an existing db with that name, it will overwrite it
> entirely?

Yes. I always use the REPLACE option together the MOVE as suggested by
Tibor.



--
Erland Sommarskog, SQL Server MVP, esquel [at] sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downlo ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books .mspx
Erland Sommarskog [ Di, 13 November 2007 23:19 ] [ ID #1869333 ]

Re: Creating Test Database

Thanks to both of you!

"Erland Sommarskog" <esquel [at] sommarskog.se> wrote in message
news:Xns99E7EE6584750Yazorman [at] 127.0.0.1...
> Neil (nospam [at] nospam.net) writes:
>> And if there's an existing db with that name, it will overwrite it
>> entirely?
>
> Yes. I always use the REPLACE option together the MOVE as suggested by
> Tibor.
>
>
>
> --
> Erland Sommarskog, SQL Server MVP, esquel [at] sommarskog.se
>
> Books Online for SQL Server 2005 at
> http://www.microsoft.com/technet/prodtechnol/sql/2005/downlo ads/books.mspx
> Books Online for SQL Server 2000 at
> http://www.microsoft.com/sql/prodinfo/previousversions/books .mspx
DM McGowan II [ Mi, 14 November 2007 01:26 ] [ ID #1870331 ]
Datenbanken » comp.databases.ms-sqlserver » Creating Test Database

Vorheriges Thema: SSIS DB to DB or DB to File
Nächstes Thema: ANSI NULL DEFAULT database option