Skip to main content

Posts

Showing posts from March, 2014

Sql Server 2005/2008 Cursor Example|Cursor Example in Sql Server 2005/2008|Create cursor in sql server

Introduction : In my previous article I have explained about SQL Query to backup database in sql server , SQL query to extract file names from a html content , How to set deadlock priority in sql server , Find count of each characters in a string in SQL Server , Use of SET NOCOUNT in sql server , Different Isolation levels in sql server in SQL Server . In this article I am going to explain about how to create cursor in sql server with example in sql server 2005/2008. Explanation: A cursor is a set of rows together with a pointer that identifies a current row. In other word, 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 and visual basic. Syntax: DECLARE cursor_name CURSOR [ LOCAL | GLOBAL ]      [ FORWARD_ONLY | SCROLL ]      [ STATIC | KEYSET | DYNAMIC | FAST_FORWARD ]      [ READ_ONLY | SCROLL_LOCKS | OPTIMISTIC ]      [ TYPE_WARNING ]      FOR select_statement