Groups | Blog | Home
all groups > sql server replication > may 2005 >

sql server replication : How do I prevent initial Snapshot to drop my tables?!


Jorge C
5/13/2005 12:00:00 AM
Hi!
I'm new to SQL Server and replication but I need to setup a publisher with
10 subscribers using Transactional Replication.

My initial problem: the initial snapshot is trying to drop my tables in the
subscriber database and I don't want this to happen! (even because it fails!
The schema is correct on all subscribers so I just want it to copy the data,
nothing more!)

How can I do this?

Thanks for your help and attention.
Jorge C.


Kevin Lang
5/13/2005 4:06:02 PM
Hi Jorge,

In the Publication's "Articles" properties you can click on the "Article
Defaults" tab (or change the properties for each article individually).
There you can specify in the "Snapshot" tab, what should happen when the
snapshot is applied. You can specify a variety of things. If you are not
going to drop and re-create the target tables, you should specify how the
data is to be deleted from the target tables before the snapshot is applied.
If you've got DRI defined on the target tables, you will not be able to use
the "delete all data from tables.." feature because it executes a "truncate",
which won't work if the table has logical "children".

Essentially, all the commands to manipulate the schema at the subscriber is
contained in the snapshot.

Cheers,
Kevin

[quoted text, click to view]
Hilary Cotter
5/13/2005 10:14:15 PM
My understanding is that SQL Server will order the creation of objects
according to dependencies and prevent this from happening.

--
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html

Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com

[quoted text, click to view]

rdc02271 NO[at]SPAM yahoo.com
5/16/2005 6:19:45 AM
[quoted text, click to view]

Yes, but I just want to replicate these tables:
Item; ItemNames; ItemSellingPrices ; Family ;

and there are more tables such as STOCK, SaleTransactionDetails which
have
foreign keys to the Item table, FAmily,etc...

Is there a way for me to get the sql the initialization snapshot uses
to alter the tables?

Thanks for your help.

Jorge C.

[quoted text, click to view]
AddThis Social Bookmark Button