That is my SQL Server script:
SELECT
[CaseAttribute],
LEFT([CaseAttribute], CHARINDEX(',', [CaseAttribute]) - 1) AS [Function],
REPLACE(SUBSTRING([CaseAttribute], CHARINDEX(',', [CaseAttribute]), LEN([CaseAttribute])), ',', '') AS [Module]
FROM
view_CaseAttribute
and my string = 'Change shift,Change shift,DInex'
. When I run the script I get an error:
Msg 537, Level 16, State 5, Line 1
Invalid length parameter passed to the LEFT or SUBSTRING function.