Has anyone has success using this (excellent) sproc and sending to a group? We have 1 report, 1 parameter (userid), and several users getting the same report queried for their userid. The users receiving the report changes constantly. I'm trying to use a cursor (which prints out the result set correctly) to retrieve userid and email but the reports don't send. No errors and the job indicates that is has run once for each record in the query set. If I run the sproc for a single userid, it works fine, so email, job, etc are configured correctly. Any suggestions?
J.
*****
DECLARE curRevcon INSENSITIVE CURSOR
FOR SELECT CONTACTID, EMAIL FROM Table
DECLARE @CONTACTID VarChar(100)
DECLARE @EMAIL VarChar(100)
OPEN curRevcon
FETCH NEXT FROM curRevcon INTO @CONTACTID, @EMAIL
WHILE @@Fetch_Status = 0
BEGIN
EXEC data_driven_subscription
@scheduleID = '317F5B31-B453-4037-B85A-42907A9956A4',
@emailTO = @EMAIL,
@emailCC = '',
@emailBCC = '',
@emailReplyTO = 'me@me.com',
@emailBODY = 'Testing - did you get this?',
@param1 = @CONTACTID
FETCH NEXT FROM curRevcon INTO @CONTACTID, @EMAIL
END
CLOSE curRevcon
DEALLOCATE curRevcon
GO