question

Zaheer avatar image
Zaheer asked

Primary Keys are missing in Subscriber Tables

After db restore on Subscriber server, i configured transaction replication SQLServer 2005. then later few tables were added with Primary Key so that they can be part of replication, i ran the snapshot and everything went fine. When a bulk load test happend the process was too long, after investigation, i found the subscriber tables are not having the primary Keys, and it was doing full table scan.

I am bit confused here, how my Primary Keys are missing in Subscriber tables, which seems to me very odd. Any help or pointers would be much appreciated. Thanks...

replication
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Zaheer avatar image Zaheer commented ·
Publisher table didn't had the primary key, after configuring replication, I've added the PK on publisher tables, then ran Snapshot which has added these tables in replication. When I am doing a simple data entry on those tables, the data is getting replicated to subscriber, but when I looked the table design, i am not seeing the PK (Clustered Index) on Subscriber (for those tables which got added after snapshot execution)
0 Likes 0 ·
Zaheer avatar image Zaheer commented ·
I am very glad to heve a response from Steve Jones, thanks much Steve.
0 Likes 0 ·

1 Answer

·
Steve Jones - Editor avatar image
Steve Jones - Editor answered

If you had primary keys on the publisher tables from the start, they should have been put through when the tables were created on the subscriber. Did you let replication create the subscribed tables or were they manually created?

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.