Hi friends
Can anybody here make a simple cursor which fetch one by one row of a table and call it from asp.net front page.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Pankaj RanaPosted Dec 8, 2011, 9:11 AM
Declare @Lastname varchar(50)
DECLARE @Email varchar(20)
DECLARE Student_cursor CURSOR FOR
Select Firstname,Lastname,Email from student
OPEN Student_cursor;
FETCH NEXT FROM Student_cursor
INTO @Firstname, @Lastname, @Email;
WHILE @@FETCH_STATUS = 0
BEGIN
print '---------------'
print @Firstname
print @Lastname
print @Email
print '---------------'
FETCH NEXT FROM Student_cursor
INTO @ItemID;
END
CLOSE Student_cursor;
DEALLOCATE Student_cursor;
Refer this
http://queriesinsql.blogspot.com/2011/12/cursor-in-sql-with-example.html
Pankaj RanaPosted Dec 10, 2011, 5:00 AM
Akshay TeotiaPosted Dec 10, 2011, 12:29 AM