Saturday, February 25, 2012

question

is it possible to use table variable in a cursor?
what else are limited in cursor?Why do you think you need cursors?
"Kevin" <pearl_77@.hotmail.com> wrote in message
news:%23Xr1ZceyFHA.2064@.TK2MSFTNGP09.phx.gbl...
> is it possible to use table variable in a cursor?
> what else are limited in cursor?
>
>|||Aaron, just a question, I got this question from an interview.
"Aaron Bertrand [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:uxoaTdeyFHA.460@.TK2MSFTNGP15.phx.gbl...
> Why do you think you need cursors?
>
> "Kevin" <pearl_77@.hotmail.com> wrote in message
> news:%23Xr1ZceyFHA.2064@.TK2MSFTNGP09.phx.gbl...
>|||Possible? Yes. Desirable? No.
The best way is usually to avoid cursors.
David Portas
SQL Server MVP
--|||Ah ha, the old "What are the advantages of cursors?" trick question.
Don't fall for that one. ;-)
David Portas
SQL Server MVP
--|||how many types of cursors are there in sql 2000?
"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:1128542718.092121.232930@.g14g2000cwa.googlegroups.com...
> Possible? Yes. Desirable? No.
> The best way is usually to avoid cursors.
> --
> David Portas
> SQL Server MVP
> --
>|||Define "Type of cursor". Or, better yet, look up DECLARE CURSOR in Books Onl
ine.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Kevin" <pearl_77@.hotmail.com> wrote in message news:ekBB6keyFHA.3696@.TK2MSFTNGP10.phx.gbl.
.
> how many types of cursors are there in sql 2000?
> "David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
> news:1128542718.092121.232930@.g14g2000cwa.googlegroups.com...
>|||On 5 Oct 2005 13:08:07 -0700, David Portas wrote:

>Ah ha, the old "What are the advantages of cursors?" trick question.
>Don't fall for that one. ;-)
Hi David,
"What are the advantages of cursors?"
"That they can almost always be converted to set-based code."
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)|||> Ah ha, the old "What are the advantages of cursors?" trick question.
> Don't fall for that one. ;-)
Well, answer it smartly. They keep set-minded people employed, as with very
little work getting rid of the cursors, they can vastly increase the
performance of any inherited system. ;)|||> "What are the advantages of cursors?"
> "That they can almost always be converted to set-based code."
In other words: "they leave room for improvement, allowing the client to be
charged twice for the same job." :)
ML

No comments:

Post a Comment