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

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -