Settung identity property to the existing table column

  • Hi,

    Does any one of you have come accross a script where we can set a identity to the data existing table

    exec sp_set_Identity ( TableName,ColumnName)

    Thankx




    My Blog: http://dineshasanka.spaces.live.com/

  • AFAIK you can't do that. You either need to create a clean new table, or 1) add a new column with the identity property and 2) drop the old column.

    Which is best depends on each situation, you should consider each carefully though, when deciding which way to go, so nothing else gets messed up in the process.

    /Kenneth

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

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