Trigger or Notification

  • Hi

    I want if record added/updated in particular table before a particular date i should get message or notification or email should go.

    Log should also get maintained of that entry

    Thanks

     

    • This topic was modified 2 years ago by  jsshivalik.
  • That is a requirement. But what is your question?

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • Hi

    I want email should go and if date entered is < 30/03/2022 Below is the code

    CREATE TRIGGER dbo.TRG_Users_ChangeTracking

    ON dbo.Users

    AFTER INSERT

    AS

    BEGIN

    SET NOCOUNT ON;

    INSERT INTO ChangeTrackingHistory(UserID)

    SELECT i.UserID

    FROM inserted AS i;

    END

    GO

    Thanks

    • This reply was modified 2 years ago by  jsshivalik.
  • sp_send_dbmail (link) will send an e-mail for you. But you still have not asked a question. Sample questions:

    • How do I send an e-mail in T-SQL?
    • How do I configure e-mail in SQL Server?
    • How do I select rows based on date?
    • etc etc

     

    • This reply was modified 2 years ago by  Phil Parkin. Reason: Fix typo

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply