Skip to Content.
Sympa Menu

freetds - RE: Output parameters (was: Strange things)

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Thompson, Bill D (London)" <ThompBil AT exchange.uk.ml.com>
  • To: "'TDS Development Group'" <freetds AT franklin.oit.unc.edu>
  • Subject: RE: Output parameters (was: Strange things)
  • Date: Thu, 21 Nov 2002 08:10:54 -0000


Just to clarify on a couple of points.

Output parameters from stored procedures are still supported. So:

declare @b int
exec t0022 @b = @b output

is STILL a valid piece of TSQL

What has changed is that the TDS 7 protocol will no longer return the
contents of @b in a "parameter result" message, after a piece of SQL like
this is submitted to the server. The reasoning behind this is as follows:

In TDS 4.2 , there was no "low-level" or "direct" way of submitting a
stored procedure call to the server. The only way of doing that was to
submit a SQL statement like the one above. In order to get the ouptut
parameter back to the client, the TDS 4.2 protocol supported a "parameter
result" message when stored procedure calls were submitted in this way.
If you look at it though, this is a bit of a cludge. In this piece of SQL,
we have declared a variable, and then called a stored procedure to populate
it via an output parameter. Thats fine, and the server will do exactly what
it's asked to do. But there's nothing in that SQL which really says that the
client is interested in the contents of the variable after the stored
procedure call. So why return it ?

In TDS 7.0, there now IS a direct way of submitting a stored procedure call
to the server, passing input parameters and retrieving output parameters. So
the former method is now redundant.

Bill







Archive powered by MHonArc 2.6.24.

Top of Page