From: reb01501@NOyahooSPAM.com   
      
   Gene Wirchenko wrote:   
   > On Tue, 31 Jul 2012 09:08:01 +0000 (UTC), Erland Sommarskog   
   > wrote:   
   >   
   >> Why wouid you creaet the temp table at all? Why not just return a   
   >> result set   
   >>   
   >> SELECT 0 AS OrderBy, 'Key not found.' AS ErrorReponse   
   >   
   > I gave a simple example of error return. There may be more rows;   
   > OrderBy is for presenting them in the correct order. The additional   
   > rows may be added one at a time so I went with a table. Is there a   
   > better way?   
   >   
   >> Also, most clients gets confused if a stored procedure returns two   
   >> results sets with different shape. Of course, it's perfectly   
   >> manageable if you program the client correctly, but it's a little   
   >> dubious.   
   >   
   > (I do not know what to call the level that is between the browser   
   > and SQL Server.   
   Web Server   
      
   > It a) receives the HttpXMLRequest and queries SQL and   
   > b) receives the resultset from SQL Server and packages it for the   
   > browser. What is it called? I will now refer to it as Glue.)   
      
   It depends on the technology you are using. With IIS, you might be using   
   ASP.Net or ASP. With Apache, you might be using php.   
      
   > IIUC, you are saying that if I try to return more than one table?   
      
   No, more than one resultset. The result of a select statement is a   
   resultset.   
      
      
   > Not the case. Either I return the table data requested, or I return   
   > error data.   
   OK, but the two resultsets have different schemas and your code in the web   
   server page will need to be able to handle that.   
      
   > I do not even know how I would return more than one   
   > resultset.   
      
   Err ...   
   multiple select statements in a batch will return multiple resultsets   
      
   > Is it even possible?   
   Certainly. For example, ADO has a NextRecordset method that retrieves the   
   next pending resultset from a sql batch being executed by a Command object.   
      
   > SQL Server seems to return just the   
   > last query results.   
   No, in SSMS or Query Analyzer, if you run multiple selects in a batch,   
   either client tool will handily display all resultsets returned.   
      
   > Maybe, that is a function of my Glue layer.   
   No, it's a function of the data access technology you are using in your web   
   server code - see my reference to ADO above   
      
   I am familiar with ASP and ASP.Net. It sounds as if you don't want to use   
   either technology so you will need to find a newsgroup or forum that focuses   
   on the technology you wish to use.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|