Hello!
I have scalar function which calls from stored procedure. When SP recompiling (before start) in profiler I see Exception "Error: 536, Severity: 16, State: 5" - Invalid length parameter passed to the SUBSTRING function. at next line of function (original text changed for easy sample) :
if @.p1=4 set @.s1=substring(@.ipstr,1,@.p1-1)
but at same line like:
if @.p1=4 set @.s1=substring(@.ipstr,1,3)
works good.
Somebody can explain such?
I think you should proivide full repro with variables declaration and initialization.
Don't forget to mention MSSQL version you run this script on.
No comments:
Post a Comment