dbTalk Databases Forums  

SSE 2008: Table Parameters

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss SSE 2008: Table Parameters in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Gene Wirchenko
 
Posts: n/a

Default SSE 2008: Table Parameters - 05-06-2011 , 05:00 PM






Dear SQLers:

I have been digging into cursors. It appears that one can not
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?

Sincerely,

Gene Wirchenko

Reply With Quote
  #2  
Old   
Gene Wirchenko
 
Posts: n/a

Default Re: SSE 2008: Table Parameters - 05-06-2011 , 05:33 PM






On Fri, 06 May 2011 15:00:39 -0700, Gene Wirchenko <genew (AT) ocis (DOT) net>
wrote:

Quote:
Dear SQLers:

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.

Sincerely,

Gene Wirchenko

Reply With Quote
  #3  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: SSE 2008: Table Parameters - 05-07-2011 , 04:51 AM



Gene Wirchenko (genew (AT) ocis (DOT) net) writes:
Quote:
On Fri, 06 May 2011 15:00:39 -0700, Gene Wirchenko <genew (AT) ocis (DOT) 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 (AT) sommarskog (DOT) 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

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.