this error showed up in C# code, while using a Stored proc on SQL 2005. The error not showing up while running the stored proc from mgmt studio. so far it sounds some like casting issues b/w stored procedure ‘s returend value vs C# usage…
The WEIRD THING is, when i just recomiled the SP, NO CHANGE DONE only ran the ALTER proc command again with 0 changs, and the error disappeared in the C# code.
does that make any sense? that just recomiling the SP caused the error to disappear.
thanks.
When a stored procedure is defined, a number of key
SETstatements in play are burned into that sproc (so that it behaves the same for callers). This can impact the behaviour of the sproc; suppressing warnings, causing errors, causing different behaviour, causing it to not trust persisted-calculated-indexed columns (and recalc per row), etc.It sounds to me like the
SETstatements in play when it was originally created were not suitable; by recreating it you set them to whatever was active the second time. Same TSQL; same sproc – but differentSEToptions: different outcome.Since the
SEToptions can be set as defaults in SSMS, this might mean whoever created it the first time had a non-standard setup.In particular, this affects
ANSI_NULLSandQUOTED_IDENTIFIER.