SQL Cursor is a database object used by applications to manipulate data in a set on a row-by-row basis; it’s like recordset in the ASP. SQL Server Cursor is a row base operator but cursor is not recommended because of performance issue as it create different execution plan for each rows. So one should look out for other i.e. try to implement logic with the help of while loop or CASE statement or JOIN, SELECT, GROUP etc. statements. But few times the cursor is recommended and useful, for example if you just need to update your DB only once through Query Analyzer and don’t really bothered about performance, then cursor can be handful; SQL Server Cursor Basics: Before jumping to example, let’s see basics of SQL Cursor statements. Statement Description DECLARE Declare variables used in the code block SET\SELECT Initialize the variables to a specific value DECLARE CURSOR Populate the cursor with values that will ...