Discussion Locked

Create a Task in MSSql task Manager

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I want to create a task in MSSql DTS Manage that will Empty/clear a temp table, check another table and look at one of the fields, if that field is NULL, put a entry into the temp table for each of the entries that contains a NULL and send a email. The task is to be run every 45 mins.

I have been able to create the above but the hard part for me is if there are no NULL entries and after running the task the Temp table is empty I dont want a e-mail sent...

Can anyone shed some light on this

3 replies

by tony hopkinson

Not sure if I'm understanding your problem correctly
but
Declare @NullCount int
Select @NullCount = (Select Count From #TempTable)
If @NullCount = 0 Then
....

Can't remember the name but there used to be a extended stored procedure for sending a mail.

Something like that anyway.

This discussion is closed to new replies.