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,046 of 19,505   
   Jeroen Mostert to Gene Wirchenko   
   Re: Getting the SET ROWCOUNT Value   
   24 Dec 10 07:16:10   
   
   XPost: microsoft.public.sqlserver.programming   
   From: jmostert@xs4all.nl   
      
   On 2010-12-24 03:35, Gene Wirchenko wrote:   
   >       Is there any way to get the SET ROWCOUNT value?   
   >   
   Here's one I can think of, though it's probably not what you where hinting at:   
      
      DECLARE @c INT;   
      SET ROWCOUNT 10;   
      SELECT @c = n FROM Nums ORDER BY n;   
      SET ROWCOUNT 0;   
      SELECT @c + 1;   
      
   I assume you've got a "nums" table, of course (mine contains zero, hence the   
   +1).   
      
   >       Generalise to any SET parameter values.   
   >   
   If you mean any possible *kind* of SET parameter (so not just SET ROWCOUNT),   
   then take a peek:   
      
      SELECT * FROM sys.dm_exec_sessions WHERE session_id = @@SPID;   
      
   Beware, the table has a row_count column but this does *not* correspond to   
   the ROWCOUNT setting (I'm not exactly sure what it *is* supposed to contain,   
   despite BOL describing it as "Number of rows returned on the session up to   
   this point").   
      
   --   
   J.   
      
   --- 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