Re: Can a procedure contain only a SELECT statement?

From: Serge Rielau <>
Date: Thu, 25 Mar 2010 16:34:20 -0400
Message-ID: <>

On 3/25/2010 11:38 AM, Jonathan Lewis wrote:
> On the other hand, in the SQL Server world you can have a procedure
> that has no apparent feature for a formal definition of what it's going to
> output - and therefore no formal mechanism for the front-end to associate
> what it's expecting with what the database code might deliver.
Actually I think that is an outdated statement. AFAIK TSQL does at least have the concept of table parameters (which is roughly equivalent to an associative array of records).

Another key difference of TSQL is that these select statements within a batch or procedure flow back to the client immediately. That is while the TSQL script is still executing.
So when you invoke a procedure result are coming back long before the procedure completes. PRINT is a special case of that.

This makes for a different approach to track progress compared to APPLICATION_INFO. Quite interesting, actually.


Serge Rielau
SQL Architect DB2 for LUW
IBM Toronto Lab
Received on Thu Mar 25 2010 - 15:34:20 CDT

Original text of this message