travisbrown
Technical User
- Dec 31, 2001
- 1,016
I've always sort of avoided DTS jobs, save simple things like data import and export, but now I need to schedule an email based on query results.
I run a query on an orders table. If there are any orders flagged as new, I need to send an email. If not, then finish. I've sent emails in DTS before, but not conditional on the results of a query. How might one get started on this?
Query is simply
SELECT COUNT(order_status) AS Expr1
FROM dbo.tbl_orders
WHERE (order_status = 1)
GROUP BY order_status
or
SELECT order_status
FROM dbo.tbl_orders
WHERE (order_status = 1)
I run a query on an orders table. If there are any orders flagged as new, I need to send an email. If not, then finish. I've sent emails in DTS before, but not conditional on the results of a query. How might one get started on this?
Query is simply
SELECT COUNT(order_status) AS Expr1
FROM dbo.tbl_orders
WHERE (order_status = 1)
GROUP BY order_status
or
SELECT order_status
FROM dbo.tbl_orders
WHERE (order_status = 1)