Help me- Replicate a table without primary key | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Help me- Replicate a table without primary key

Hi all I set up a transactional replication between two server (Server A and Server B). In Server A, I have a table that do not have a privary key field (but have many date) and I want to replication (transactional replication) the table. Can you tell how I have to do ? Thanks in advance.
you have to either find a combination of unique non null columns or add a surrogate key (i.e. identity field) or use snapshot replication for that table… Cheers
Thanks Twan, Other ideal ???
Hi, the second problem with replication is as the following: The objects that I want to replicate are Tables, Stored Procedure, Views and User Defined Functions. But in the process to make a replication, I do not see Views, User Defined Objects to chose. Can you tell me the reason ? Thanks
replication only really copies the data, not the structure or other objects. If you wanted to replicate those then you’d need to look towards something like logshipping I’m not sure why MS decided to not allow replication of the actual objects, like sps, views, etc. Cheers
Thanks Twan
MS allows replicate tables, stored procedures, but don’t allow replicate views, user defined objects.
when MS says that is replicates stored procedures, pretty sure that it only replicates the calling of the procedures not the actual procedure code itself… Cheers
Views are virtual tables and you can script them to transfer. Satya SKJ
This posting is provided “AS IS” with no rights for the sake of knowledge sharing.