Sql-server – Mysterious procedure calls without parameters – but no exceptions generated

parameterprofilersql serverstored-procedurestrace

I've been tracing a handful of stored procedures with EventClass RPC:Completed that are intermittently called from .Net SqlClient Data Provider without required parameters – just "exec SprocName".

If I manually call them as they appear in the trace's TextData, they generate an exception – but no exceptions are being generated in the original trace. The Error column for these "parameterless" calls does show "1 – Error," but I don't understand how the call is not generating an exception.

At first I suspected it was a glitch with profiler, that "1 – Error" caused parameters to be truncated from the TextData, but I see the same results in an extended events session.

Has anyone seen anything like this in their profiler traces or event sessions? The app is almost certainly making these calls as part of some edge-case error, but why is sql server not throwing an exception?

Best Answer

SET PARSEONLY ON will do this. FMTONLY will generate an error.

EG:

USE [AdventureWorks]
GO

set parseonly on
go
exec [uspGetBillOfMaterials]
go
set parseonly off