Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Emailing within DTS package

Author  Topic 

ninel
Posting Yak Master

141 Posts

Posted - 2006-07-11 : 15:31:36
I need to create a DTS package that sends out an email based on a query.

Query:

SELECT @Count= count(*) FROM employee WHERE site = 1


If @Count=0 I don't want an email to be sent. If @Count>=1 then the email should be sent out.

How do I set up the package to reflect this?

Thanks,
Ninel

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2006-07-12 : 08:56:24
Use an IF statement on @Count..
[code]
IF @count >= 1
BEGIN
EXEC master.dbo.xp_sendmail....
END
Go to Top of Page
   

- Advertisement -