sql - Invalid length parameter error -
i'm passing list of names ssrs sql server stored procedure i'm getting error:
invalid length parameter passed left or substring function
this code:
select substring(item, 1, len(item) - 36) dbo.fnsplit(@manager, ',')
the reason substring remove 36 character guid attached end of manager name. names passed this:
john smith, tom perry
i've read error caused spaces, can't figure out how fix this.
just use case
:
select (case when len(item) <= 36 item else left(item, len(item)-36) end) dbo.fnsplit(@manager, ',')
Comments
Post a Comment