How to set Identity in sql
I want to set identity by query . . in my table column sno i am set all ready set identity to yes but i want to set id column as a identity in a query how'z the possible suggest me .
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Ankit NandekarPosted Apr 11, 2011, 5:41 AM
like
Alter Table student Drop column [sno]
Alter Table student Add id int identity(1,1)
Ankit NandekarPosted Apr 11, 2011, 5:45 AM
Prabhakar PariharPosted Apr 11, 2011, 5:43 AM
Prabhakar PariharPosted Apr 11, 2011, 5:26 AM
Prabhakar PariharPosted Apr 11, 2011, 5:21 AM
Ankit NandekarPosted Apr 11, 2011, 5:17 AM
You can not remove Identity propery of a column with out droping it.
Prabhakar PariharPosted Apr 11, 2011, 4:28 AM
Ankit NandekarPosted Apr 11, 2011, 4:24 AM
CREATE TABLE student (
[sno] [int] IDENTITY(1,1) NOT NULL,
)