dbTalk Databases Forums  

Creating Test Database

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss Creating Test Database in the comp.databases.ms-sqlserver forum.



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

Default Creating Test Database - 11-13-2007 , 12:34 AM






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!



Reply With Quote
  #2  
Old   
Tibor Karaszi
 
Posts: n/a

Default Re: Creating Test Database - 11-13-2007 , 01:31 AM






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 (DOT) net> wrote

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



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

Default Re: Creating Test Database - 11-13-2007 , 02:39 PM



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

"Tibor Karaszi" <tibor_please.no.email_karaszi (AT) hotmail (DOT) nomail.com> wrote in
message news:F4D3C4C1-35C2-4CFE-81C0-A7AF434911AA (AT) microsoft (DOT) com...
Quote:
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 (DOT) net> wrote in message
news:EAb_i.20588$Pv2.7236 (AT) newssvr23 (DOT) 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!





Reply With Quote
  #4  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: Creating Test Database - 11-13-2007 , 04:19 PM



Neil (nospam (AT) nospam (DOT) net) writes:
Quote:
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 (DOT) se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx


Reply With Quote
  #5  
Old   
Neil
 
Posts: n/a

Default Re: Creating Test Database - 11-13-2007 , 06:26 PM



Thanks to both of you!

"Erland Sommarskog" <esquel (AT) sommarskog (DOT) se> wrote

Quote:
Neil (nospam (AT) nospam (DOT) 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 (DOT) se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx



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.