• luckysql.kinda (2/16/2010)


    Following is the empdetails table in my organization which has been used for last 3 years.

    create table Empdetails(empid int , empname varchar)

    We noticed that there was no primary key and now we are looking for transactional replication to replicate this data. How can I create primary key on this table. According to my understanding the primary key can be created only when the table is created. Do I need to create a dummy table and then transferring data, rename this table as Empdetails after dropping the original table?

    -Lk

    ALTER TABLE Empdetails ADD CONSTRAINT PK_Empdetails PRIMARY KEY ....

    Refer BOL for more information.