a guest Dec 6th, 2018 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- DECLARE @role varchar(20)
- select @role = u.[role] from inserted i join users u on u.id = i.creator_id
- if @role = 'client'
- update TableA
- set updated_date = i.created_date from inserted i where TableA.id = i.trans_id
- if @role = 'tech'
- update ticket
- set updated_date = i.created_date from inserted i where TableA.id = i.trans_id and i.[public] = 'true'
RAW Paste Data