Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.ms-sqlserver > #302

Re: SSE 2008: Table Parameters

From Erland Sommarskog <esquel@sommarskog.se>
Newsgroups comp.databases.ms-sqlserver, microsoft.public.sqlserver.programming
Subject Re: SSE 2008: Table Parameters
Followup-To comp.databases.ms-sqlserver
Date 2011-05-07 11:51 +0200
Organization Erland Sommarskog
Message-ID <Xns9EDE78A7A35F9Yazorman@127.0.0.1> (permalink)
References <unr8s65naj0l34l6vqr6s28esiur3n8ffv@4ax.com> <p4t8s6tl8dk779p73l01r81iv6da7de9p5@4ax.com>

Cross-posted to 2 groups.

Followups directed to: comp.databases.ms-sqlserver

Show all headers | View raw


Gene Wirchenko (genew@ocis.net) writes:
> On Fri, 06 May 2011 15:00:39 -0700, Gene Wirchenko <genew@ocis.net>
> wrote:
>>     I have been digging into cursors.  It appears that one can not
>                                       ^ and the like
>>modify a cursor variable passed as a parameter.  Being able to do so
>           ^^^^^^
>>would be very useful.  What do you do when you need to modify a cursor
>  ^^^^^^
>>parameter?  Or what is the workaround?
> 
>      Whoops!  Read as "table".
> 
>      What do you do when you want to treat a cursor as a table?
> 
>      I want to build a cursor of data manipulating it with SQL
> commands as I would a table and then update another table using the
> cursor as a cursor.
 
For your original question, I was about to answer that I don't use cursor
variables or parameters.

The fact that table-valued parameters are READONLY only makes them half as
useful as they could have been. Or maybe only 30% as useful. I have an
article on my web site that discusses a number of workarounds:
http://www.sommarskog.se/share_data.html-

I'm not sure that I understand your actual question, though. What do
you mean with "treat a cursor as a table"?


-- 
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx

Back to comp.databases.ms-sqlserver | Previous | NextPrevious in thread | Find similar


Thread

SSE 2008: Table Parameters Gene Wirchenko <genew@ocis.net> - 2011-05-06 15:00 -0700
  Re: SSE 2008: Table Parameters Gene Wirchenko <genew@ocis.net> - 2011-05-06 15:33 -0700
    Re: SSE 2008: Table Parameters Erland Sommarskog <esquel@sommarskog.se> - 2011-05-07 11:51 +0200

csiph-web