• Thanks for ur Comments and reply,

    First: I have two columns; one for the 'DayTransDate' like (2008/08/09) which is stored in the Data base as a Decimal= 20080709, and the other is for 'DayTransTime' like (12:08:44) which is stored in the Data base as a Decimal= 120844.

    And I get these two dates when the rows are inserted into the table. So I used the first option to get the last rows in the last 30 minutes, which is by:

    What I did is: I've created a job with one step containing the following code to check the new rows and then send email, and schedule this job to run every 30 minutes.

    If Exists (Select * From MyTable Where DayTransTime >= dateadd(minute, -30, getdate()))

    Begin;

    code to send email

    End;

    I tried the previous code and email is sent successfully, BUT this code is always sending Email every 30 minutes and does not behave that it checks if new rows had been inserted in the last 30 minutes.

    I don't know if you gues got the problem or not, but I tried it and email is sent every 30 minutes wheather there are new rows or not.

    Note # 1: I don't wanna send Email if there is no new rows inserted in the last 30 minutes.

    Note # 2 (important): I passed the body of the Email manually (normal text), but I need to send the new rows inserted in the last 30 minutes...Is this possible???