• SQL Frenzy (2/25/2008)


    Hi,

    Can we have two identity columns on a single table?

    If not then how can one insert an identity column in a table having an identity column?

    Regards,

    Ahmad

    The answer is simple: you can only have 1 identity column per table. If what you want with the second part of your question is to move the identity attribute from one column to the other, personally I don't see why one would do such a thing as you already have an identity, then first you have to turn off the identity on your original column and then add another column with identity attribute.

    As per article, the best way to go is in the Enterprise Manager or Management Studio in design mode on the table, switch on the identity attribute on the column, copy the SQL that was generated and then save it in a file.

    Don't just give the hungry man a fish, teach him how to catch it as well.

    the sqlist