title: How use inserted\deleted table in stored procedure?
body: <p>I creating triggers for several tables. The triggers have same logic. I will want to use a common stored procedure.
  But I don't know how work with <strong>inserted</strong> and <strong>deleted</strong> table.</p>
  
  <p>example:</p>
  
  <pre><code>SET @FiledId = (SELECT FiledId FROM inserted)
  begin tran
     update table with (serializable) set DateVersion = GETDATE()
     where FiledId = @FiledId
  
     if @@rowcount = 0
     begin
        insert table (FiledId) values (@FiledId)
     end
  commit tran
  </code></pre>