I’m trying to change what the stored procedure returns without altering data. I’m trying to have it return 1 every time LinkItemType = 3, but I keep getting syntax error. Please help.
Here is what I have.
DECLARE @ITEMTYPE Int
SELECT TOP 1000
[DataID]
,[ContactServiceID]
,[LinkID]
,@ITEMTYPE
WHEN [LinkItemType] = 3 THEN @ITEMTYPE = 1 ELSE @ITEMTYPE = [LinkItemType]
FROM
[BCM2010].[dbo].[EntityReferences]
WHERE
dataid = 54
ORDER BY
LinkItemType DESC
What Laurence said is correct. What you are looking for is likely:
(note, I am not using your variable)