home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.ms-sqlserver      Notorious Rube Goldberg contraption      19,505 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 18,305 of 19,505   
   Erland Sommarskog to Gene Wirchenko   
   Re: SSE 2008: Table Parameters   
   07 May 11 11:51:39   
   
   XPost: microsoft.public.sqlserver.programming   
   From: esquel@sommarskog.se   
      
   Gene Wirchenko (genew@ocis.net) writes:   
   > On Fri, 06 May 2011 15:00:39 -0700, Gene Wirchenko    
   > 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   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca