Primary Key

  • All:

    I understand from the documentation that I need a primary key for every table that I want to replicate. Can someone tell me how to do this dynamically thru a script, so I don't have to assign one for each table that doesn't have one? I suppose I could use the first column of each table

    thanks in advance

  • You might find that you need more changes to your tables then just Primary Keys.

    I would suggest mannually replicating a few tables in development first. Just use the wizards in Enterprise Manager, and they will make some small changes to your tables as needed (usually adding a ROWGUID or timestamp or something to track row changes).

    Once you can see the amount of stuff Replication is wanting to be changed to get going, you'll have a better idea.

    Also, your Primary Key is a pretty important thing in a good database. I would recommend reading up articles in BOL and on this site about how to decide on creating the best primary key for each table. Almost all tables should have a primary key, which is the basis for relationships, which make coding so much easier! It's worth your effort in the long run to get it right the first time!

     


    Julian Kuiters
    juliankuiters.id.au

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply