dbTalk Databases Forums  

Creating a mirror image of a database

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Creating a mirror image of a database in the microsoft.public.sqlserver.dts forum.



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

Default Creating a mirror image of a database - 11-04-2004 , 01:29 PM






Hello,

I have been learning DTS for a couple weeks now, and have been relatively
successful with using the transformations and SQL queries to create
statistics tables.

However my current task requires that I essentially take one of our
databases and make an exact copy of it on the same machine. I have
experimented with the import/export wizard, and with using 'generate SQL
script' in a SQL query along with a transformation, but there is a problem
with these options. Our databases use ID's which are flagged as Identities,
so when I bring over the table data, SQL Server generates them itself instead
of using the values in the original database. This is an issue because any
gaps in our ID's will offset the ID's in the new database, and if I ever
import more than once it will just start the ID's at the next highest number.

Is there a way to copy over tables EXACTLY as they are, even if these tables
use columns set as Identities? I considered looking into Replication, but
that sounded like a way to synchronize databases in different geographic
locations as opposed to making a simple copy on the same machine.

Any help would be greatly appreciated

Mike Kron

Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Creating a mirror image of a database - 11-04-2004 , 02:47 PM






Forget DTS. By far the easiest way is to use BACKUP/RESTORE. You can
restore as a different name and place the files in a different location
using the WITH MOVE clause to RESTORE DATABASE


--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.konesans.com - Consultancy from the people who know


"Mike Kron" <MikeKron (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hello,

I have been learning DTS for a couple weeks now, and have been relatively
successful with using the transformations and SQL queries to create
statistics tables.

However my current task requires that I essentially take one of our
databases and make an exact copy of it on the same machine. I have
experimented with the import/export wizard, and with using 'generate SQL
script' in a SQL query along with a transformation, but there is a problem
with these options. Our databases use ID's which are flagged as
Identities,
so when I bring over the table data, SQL Server generates them itself
instead
of using the values in the original database. This is an issue because
any
gaps in our ID's will offset the ID's in the new database, and if I ever
import more than once it will just start the ID's at the next highest
number.

Is there a way to copy over tables EXACTLY as they are, even if these
tables
use columns set as Identities? I considered looking into Replication, but
that sounded like a way to synchronize databases in different geographic
locations as opposed to making a simple copy on the same machine.

Any help would be greatly appreciated

Mike Kron



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.