Posts

Showing posts from October, 2024

SQL Queries - Assignment-8

 ASSIGNMENT 08 ---------------------------- Interview Questions Based On IDENTITY in SQL Server  What is the purpose of the IDENTITY property in SQL Server? How do you define an IDENTITY column in SQL Server? Can you insert values manually into an IDENTITY column? If yes, how? How would you reset the identity seed of a table after deleting all rows from it? What is the difference between an IDENTITY column and a SEQUENCE in SQL Server? What is SCOPE_IDENTITY() and how does it differ from @@IDENTITY and IDENT_CURRENT()? How can you retrieve the last identity value generated in the current session or scope? Explain how DBCC CHECKIDENT works. Can an IDENTITY column have a negative seed or increment? What happens if you try to insert a record after the identity value reaches its maximum limit? How would you handle gaps in an IDENTITY column caused by transaction rollbacks or deletions? If you delete a row from a table with an IDENTITY column, will SQL Server reuse that identity va...