Hi Herman,
this error is not because of the long string, there are some rows where there's a "user=", but no "reportPath=" resulting in a negative value in FOR which errors out.
You need a WHERE condition or a CASE to filter:
CASE WHEN SqlTextInfo like ''%user=%reportPath=%' THEN SUBSTRING... END
Dieter
↧