Identity Column in SQL Server – Part 7

Công Nghệ

In this video we will learn
1. What is Identity column
2. Creating an Identity column
3. Supply explicit values for identity columns using IDENTITY_INSERT
4. Reset identity value using DBCC CHECKIDENT command

Text version of the video


All SQL Server Text Articles

All SQL Server Slides

All Dot Net and SQL Server Tutorials in English

All Dot Net and SQL Server Tutorials in Arabic


Xem thêm bài viết khác:

42 thoughts on “Identity Column in SQL Server – Part 7

  1. Hi, I am having a problem with one of my tables with regards to identity value. It has a lot of records but the result of DBCC Checkident(tablename,noreseed) is null. Tried to reseed but to no avail or no changes takes place

  2. I came here to fix the error at 8:24, It's been a struggle trying to solve. Then I was like, "wait, I had this error before and Venkat solved it. Let me check youtube". And you solved it again, so thank Mr. Venkat, I recommend your videos to all my Software Developer friends, cause you are that good.

  3. Dear sir,

    i have a question, you explained very nicely, but i like to know if without deleting all the records from tblperson1 , if we reseed to 0 again and inserted rows accordingly , so all that id is duplicated how it will be managed.


  4. Youtube comments are full of amusements sometimes….

  5. Sir please help me , If I delete one record from middle of the table and if now i want my id's in serialized order what should I do?

  6. Sir, your videos are just wonderful.
    Can anyone help, I do not do any DBA's work and trying to see whether Constraints & Identity Columns are they used when DBA's try to set data into tables?

  7. Hi Guys.. I am new to SQL. I have a question to ask. I have an already created table. On that i added a new column by using Alter Table ADD. Now my new column is showing all NULL values. But i want to add values to it. There are 15 rows where i need to add values. How do i do that.

  8. hi sir, can we reseed the identity column from the middle of the table as clearing the whole table will be difficult

  9. Please someone clear my doubt. what are the other options available (if any) to DBCC CHECKIDENT command other than 'RESEED'?

  10. can we add identity feature to the existing table ? If yes how , i tried to do it in Test environment , but its throwing me error as "it cant done as i need to drop or re create the table "

  11. If we delete some rows, is there any way the SQL server automatically inserts new rows into those gaps? Or is manually toggling IDENTITY_INSERT and inserting the only option?

  12. Thank you very much for the tutorial, I learned today a lot, again. Life without learning is pointless and so gray and sad…

  13. You can't alter the existing columns for identity. You have 2 options,
    i. Create a new table with identity & drop the existing table.
    ii. Create a new column with identity & drop the existing column

  14. Hi Sir, is it possible to add identity constraint to existing table. I have used the query is
    alter table tablename add constraint constraintname column
    but it is showing error, could you please explain me the possible way to alter the identity constraint

    Thank You..!

  15. I have watched several of your videos and I want to tell you that you're 'A GIFTED MAN FROM GOD'. Honestly!!, you deserve A Nobal Prize. Thank you so much for your help.

Leave a Reply

Your email address will not be published. Required fields are marked *