What are SQL Cursors and how can I apply them to a simple database table?
I'm trying to understand what cursors are and what use they are to me as a developer.
Please explain what they are and what benefit they bring over using say Entity Framework with an IQueryable<T>
collection.
Also, imagine I have a table called Person. How would I apply cursors t开发者_如何学JAVAo this table?
create table Person
(
ID int primary key,
Name nvarchar,
LastName nvarchar
);
Cursors allow to process rows one by one. It's better to avoid using cursors as they are usually very slow compared to set based query operations. Here is some documentation about cursors to get you started: DECLARE CURSOR (Transact-SQL)
精彩评论