Any way to have reporting services subscriptions email only when query returns results?
Users are only wanting emails when there are results from a 开发者_开发知识库query....is there anyway to get a SSRS subscription to do this?
If you cause the report to fail to render you should be able to cancel the subscription processing - taking that in mind you could run some code embedded in the report that checks to see if data exists and if none does then force the report to fail.
This is all a guess mind you - I have never tried it!
Yes but you have to throw an error when the row count is 0. This means that SSRS cannot render anymore the report and showing the error message. On the stored proc or inline select you have to do something like this:
SELECT
*
FROM
finalselect
IF @@rowcount = 0
BEGIN
RAISERROR('NO ROWS', 16, 1)
END;
精彩评论