boutique replica bags up ideas

the best replique rolex and prices here.

julia highlight 99j hair color 10a quality straight human hair lace front wigs 8 - 24 inches pre plucked hairline 13x4 inches lace front brazilian wig onlinefor sale

Using Cursor in SQL Server

Updated on     Kisan Patel

A cursor is a database object used retrieve data from a result set one row at a time or row-by-row basis.

Syntax to declare cursor

DECLARE vend_cursor CURSOR
FOR SELECT * FROM Purchasing.Vendor
OPEN vend_cursor
FETCH NEXT FROM vend_cursor

Here is the the simplest example of the Cursor in SQL Server.

sql_server_cursor

DECLARE @student_roll int, @student_name nvarchar(50)

DECLARE student_cursor CURSOR
    FOR SELECT name, roll_no FROM Student
  OPEN student_cursor
      FETCH NEXT FROM student_cursor INTO @student_name, @student_roll
      WHILE @@FETCH_STATUS = 0
      BEGIN
        print @student_name
        FETCH NEXT FROM student_cursor INTO @student_name, @student_roll
      END
  CLOSE student_cursor
DEALLOCATE student_cursor

sql_server_cursor_example


SQL Server

Leave a Reply