Hi What is sql cursor ?
How this work ?
Where I should use it?
Thaks :$)
1. Look up DECLARE CURSOR in BOL. It gives a description and code examples
at the bottom.
2. It fetches a single row at a time from a resultset.
3. You should use it very rarely.
<re.tf@.newsgroup.nospam> wrote in message
news:OMUGWjebFHA.2736@.TK2MSFTNGP12.phx.gbl...
> Hi What is sql cursor ?
> How this work ?
> Where I should use it?
> Thaks :$)
>
|||There is a section on cursors in the SQL Server 2000 Books Online:
http://msdn.microsoft.com/library/?u...asp?frame=true
Alan Brewer [MSFT]
Content Architect
SQL Server Documentation Team
This posting is provided "AS IS" with no warranties, and confers no rights.
|||Cursors are constructs that gives you access to data on a row-by-row basis
rather than a declarative set-based basis.
Cursors mostly aren't a good choice for data manipulation operations at all.
In general, try to avoid them because they are usually slow and more complex
to develop and support than the alternatives. In fact it seems that most
cursors are written by people who don't know better techniques. That's why I
would say you should consider them an advanced feature. Only when you know
SQL very well will you have the experience to identify when cursors are a
good idea. Meantime, concentrate on learning "proper" SQL. :-)
David Portas
SQL Server MVP
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment