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.
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 >= 1BEGINEXEC master.dbo.xp_sendmail....END |
|
|
|
|
|