views:

61

answers:

1

I've got a stored procedure with an int output parameter. If I run SQL Server Profiler, execute the stored procedure via some .Net code, and capture the RPC:Completed event, the TextData looks like this:

declare @p1 int
set @p1=13
exec spStoredProcedure @OutParam=@p1 output
select @p1

Why does it look like it's getting the value of the output parameter before executing the stored procedure?

A: 

The RPC:Completed event class indicates that a remote procedure call has been completed. So the output parameter is actually known at that point. See if tracing the RPC:Started shows you what you expect.

edosoft
Ok, I see, in the RPC:Started event the @p1 variable is set to NULL. Makes sense I suppose.
Graham Clark