Thursday, March 22, 2012

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!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@.nospam.netwrote in message news:EAb_i.20588$Pv2.7236@.newssvr23.news.prodigy.n et...

Quote:

Originally Posted by

>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!
>

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

"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.comwr ote in
message news:F4D3C4C1-35C2-4CFE-81C0-A7AF434911AA@.microsoft.com...

Quote:

Originally Posted by

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@.nospam.netwrote in message
news:EAb_i.20588$Pv2.7236@.newssvr23.news.prodigy.n et...

Quote:

Originally Posted by

>>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!
>>


>

|||Neil (nospam@.nospam.net) writes:

Quote:

Originally Posted by

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/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||Thanks to both of you!

"Erland Sommarskog" <esquel@.sommarskog.sewrote in message
news:Xns99E7EE6584750Yazorman@.127.0.0.1...

Quote:

Originally Posted by

Neil (nospam@.nospam.net) writes:

Quote:

Originally Posted by

>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/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

No comments:

Post a Comment