transactional replication

  • I am trying to setup transaction replication on an SQL2000 database. Some of the tables don't have primary keys so they are not replicating. I have been told to set the autonumber field as the primary key but not all the tables have an autonumber field.

    Is there an easy way to insert the autonumber field into an existing table so I can use it as the primary key and replicate all my tables?

  • ALTER TABLE tblname

    ADD COLUMN myid IDENTITY (1,1)

    Adding an IDENTITY column can take a while as it needs to number up every row in the table.

    -Bill

  • so that will add the column, does it make it the primary key and add the identity seed info in the bottom of the description.

    Thanks for the info

    Brian

  • Hi Brian,

    No it will not make it a Primary Key. This is up to you to create. Either by script or in the table designer. You will, of course, see the Identity property and seed info in the table designer.

    Regards

    Graeme

Viewing 4 posts - 1 through 3 (of 3 total)

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