What are cursors? Explain different types of cursors. What are the disadvantages of cursors? How can you avoid cursors?

Cursors allow row-by-row precessing of the result-sets. Types of cursors: Static, Dynamic, Forward-only, Keyset-driven. Disadvantages of cursors: Each time you fetch a row from the cursor, it results in a network roundtrip, where as a normal SELECT query makes only one rowundtrip, however large the resultset is. Cursors are also… Continue reading

How to insert a value into Auto-increment Identity Column in SQL Server.

Suppose we have a table in which a column has Auto-incremented and its value automatically increases on every row. This increasing is depends on the seed and incrementing value. Let us create a table with an auto-increment identity column : CREATE TABLE [TableName] ( [ID] [int] IDENTITY(1,1) NOT NULL, [UserName]… Continue reading

What is isolation level?

An isolation level determines the degree of isolation of data between concurrent transactions. The default SQL Server isolation level is Read Committed. A lower isolation level increases concurrency, but at the expense of data correctness. Conversely, a higher isolation level ensures that data is correct, but can affect concurrency negatively…. Continue reading