Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stored procedure output parameters in SQL Server Profiler

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?

like image 210
Graham Clark Avatar asked Feb 04 '10 09:02

Graham Clark


Video Answer


1 Answers

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.

like image 93
edosoft Avatar answered Oct 16 '22 00:10

edosoft