what is the cursor

Answer Posted / om shivaya namaha

Cursors are used to fetch the records row by row data in a
table but get the data very fast by using the cursors it is
very useful if the table contains few records in a table but
will create a performance isses if the table contain lot of
records

create cursor cursorName for
select EmpId,EmName from Employees
open cursor
while (@@FetchStatus==0)
begin
fetch next from cursorName into @EmpId , @EmName
select * from Employee where empid=@empid
end
close cursor

Is This Answer Correct ?    24 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are user controls?

660


How many web.config files can I have in an application?

630


Explain the Session state management options available with ASP.NET?

647


Can you set the session out time manually?

469


Explain the difference between an exe and a dll?

608






Explain the use of dataadapter.

685


Why we use asp.net for website development?

584


How many types of Cookies are available in ASP.NET?

683


Which .NET framework supports Web API?

682


What is an assembly? Explain its parts.

722


How does session state work in asp.net?

590


Contrast OOP and SOA. What are tenets of each ?

1839


What is the part of url?

613


What is ViewState? What does the "EnableViewState" property do? Why would I want it on or off?

764


What is asp.net and its advantages?

619