-
Transactional replication
Hi
I am tring to implement transactional replication.
How do i publish tables which donot have primary keys?...because transactional replication seems to publish only the tables which has a primary key.
Thanks
Madhukar
-
You can't publish tables without primary keys. You have to give the tables primary keys first.
-
What is the best way to generate primary keys...Sequence numbers?
Madhukar
-
Any short column with fixed values.
-
In your case, if you don't already have a key field in the data, you're probably best off adding an identity field to the table(s).
-
your subscriber will lose identity property if you are using identity column on your tables. Then you have to do customized replication
refer my article
http://databasejournal.com/features/...le.php/3483421
-
You don't need to worry about the identity property not getting transferred to the subscriber unless you plan to write to the subscriber. If you are planning to write to the subscriber and want those new records to be replicated back to the publisher, you should consider using merge replication or transactional replication with updating subscribers.
Otherwise, don't worry about the identity property on the subscriber.
-
preserving identity propery is important if you are planning to use your subscriber as your primary database when your primary server goes down. (Using replicated server as high availablity failover server)
In that case you can use customized replication.
If you use merge replication, replication wizard adds a GUID column on all the tables that you are replicating. Make sure you application can handle it.
If you have insert statements without column names as shown below, your application will fail.
insert into table1 select 'a','b','c'
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|