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,463 of 19,505   
   Erland Sommarskog to Tony C.   
   Re: Trying to understand 400 line stored   
   02 Oct 11 14:29:50   
   
   From: esquel@sommarskog.se   
      
   Tony C. (me@here.com) writes:   
   > The reader populates fields by incrementing an integer index for each   
   > field in a row not by table tnames   
   >   
   > The read uses nextresult() to move to the next restult set....   
   >   
   > My Question is: Is the order of the resultsets in the Reader the same   
   > as the order of Select statements in the stored procedure? I suppose   
   > I should have a result set for every select statement?   
      
   Yes, the result sets are returned in the reader, in the order they are   
   produced in SQL Server. Note that it is the run-time order that matters.   
   That is, if the code goes:   
      
     CREATE PROCEDURE baaaaad_sp AS   
     GOTO bottom   
     top: SELECT 989 AS xyz   
          RETURN   
     bottom: SELECT getdate() AS now   
             GOTO top   
      
   The first result set will be the date, and the second result set will the   
   number.   
      
      
      
      
   --   
   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