Tech
Forums
Jobs
Books
Events
Live
Interviews
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
2
Reply
How to update Identity Column from ROW_NUMBER in sql server
Ankit Agarwal
Apr 11 2014 8:07 AM
1.9k
Reply
Hello,
How to update Identity Column from ROW_NUMBER in sql server 2008?
I am using this query for update but it's getting error:-
Cannot update identity column 'SNO'
set IDENTITY_INSERT tableSalesQuotation ON
update tableSalesQuotation
set
SNO=SubQuery.SNO
from
(SELECT Row_Number() OVER (ORDER BY SNO) as SNO
FROM tableSalesQuotation
) SubQuery
set IDENTITY_INSERT tableSalesQuotation OFF
please help me.
Thanks in Advance.
Ankit Agarwal
Software Engineer
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
Multiple values in a column
how to convert sdf to mdf