6

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?

7

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 
  • ParseOnly is really the only possibility I see. Unfortunately I haven't been able to capture in a trace where parseonly is being set. For direct SSMS calls I can capture it with SQL: Batch Starting, but I haven't been able to catch a single instance of it being set from an RPC. Perhaps it's in an event I'm not capturing. – Chris May 22 at 19:42
  • Try setting up Extended event and capture all calls from certain hostname or user (or SPID, if you know it). – Zikato May 23 at 6:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.