title: Update only if Existing value is less than new value
body: <p>I am trying to make this code update the existing [Price] ONLY when the i.[Price] is greater than the existing. I would appreciate your help.</p>
  
  <p>MyDatabase        set ANSI_NULLS ON
          set QUOTED_IDENTIFIER ON
          GO
  --This trigger is attached to the Price_Import Table so when this table gets new price values the trigger will update the price of such items in the Mydatabase MenuItem Table which is the main item table in Mydatabase</p>
  
  <pre><code>     ALTER TRIGGER [dbo].[trgafterinsertinto_Price_Import_Table] ON [dbo].[Price_Import]
  AFTER INSERT
      AS 
      BEGIN
      SET NOCOUNT ON;
  
       UPDATE [dbo].[MenuItem] 
  SET [Price] = i.[Price] ,[Cost] = i.[Cost]
      FROM Inserted i
     WHERE MenuItem.PLU = i.PLU
     DELETE FROM dbo.Price_Import
     END
  </code></pre>
  
  <p>This code update both Cost and Price but I need help modifying it to only update price when the new price is greater than the old.</p>