I need to change the following trigger so that it removes any prefix not just "CIS-". So everything left of the first dash including the dash needs to be removed. We want to keep the trimming of the trailing = sign as well. Can someone assist me in how to modify this trigger to do this? Thanks.
ALTER TRIGGER [dbo].[Dvx_TrimCIS-VNDITNUM]
AFTER INSERT, UPDATE
SET NOCOUNT ON
VNDITNUM = REPLACE(SUBSTRING(IV00103.VNDITNUM,
CASE WHEN IV00103.VNDITNUM LIKE 'CIS-%' THEN 5 ELSE 1 END,
CASE WHEN IV00103.VNDITNUM LIKE 'CIS-%' THEN 4 ELSE 0 END),
INNER JOIN Inserted I ON
IV00103.ITEMNMBR = I.ITEMNMBR and
IV00103.VENDORID = I.VENDORID and
IV00103.ITMVNDTY = I.ITMVNDTY
IV00103.VNDITNUM LIKE 'CIS-%' OR
RIGHT(IV00103.VNDITNUM, 1) = '='