I have two queries:

<cfquery name="checksrv" datasource="master">
SELECT @@SERVICENAME;
</cfquery>

<cfquery name="checkage" datasource="master">
SELECT count (program_name)
FROM master.dbo.sysprocesses
WITH (NOLOCK)
WHERE program_name LIKE '%Agent%'
</cfquery>

I want to be notified through cfmail if

1)
query checksrv doesn't return "MSSQLSERVER"
         then,  "MSSQLSERVER not returned" in cfmail
or
query checkage doesn't return 2
         then, "Agent not returned 2" in cfmail
or
both of checksrv and checkage  don't return
         then, "MSSQLSERVER not returned and Agent not returned 2" in cfmail
or

2)
query checksrv cannot be run
         then, "MSSQLSERVER Not Avail" in cfmail
or
query checkage cannot be run
         then, "Agent Not Avail" in cfmail
or
both of checksrv and checkage cannot be run
         then, "MSSQLSERVER Not Avail and Agent Not Avail" in cfmail.

Any ideas?

tia,

jl

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:231628
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to