Creating Test Database
am 13.11.2007 07:34:01 von DM McGowan II
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!
Re: Creating Test Database
am 13.11.2007 08:31:34 von Tibor Karaszi
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" wrote in message news:EAb_i.20588$Pv2.7236@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!
>
Re: Creating Test Database
am 13.11.2007 21:39:11 von DM McGowan II
And if there's an existing db with that name, it will overwrite it entirely?
"Tibor Karaszi" wrote in
message news:F4D3C4C1-35C2-4CFE-81C0-A7AF434911AA@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" wrote in message
> news:EAb_i.20588$Pv2.7236@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!
>>
>
Re: Creating Test Database
am 13.11.2007 23:19:27 von Erland Sommarskog
Neil (nospam@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@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
Re: Creating Test Database
am 14.11.2007 01:26:36 von DM McGowan II
Thanks to both of you!
"Erland Sommarskog" wrote in message
news:Xns99E7EE6584750Yazorman@127.0.0.1...
> Neil (nospam@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@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