Thursday, June 12, 2014

Error: At least one of the following parameters must be specified. "@recipients, @copy_recipients, @blind_copy_recipients". [SQLSTATE 42000] (Error 14624).  The step failed.

I had an issue this morning while using the procedure "msdb.dbo.sp_send_dbmail". Actually I have already the procedure developed in other server and am trying to use the same in different server. Received below error while executing the SQL Job which is calling this procedure.

I Investigated and came to know what the issue is: Below is my code using in procedure to send an alert. The profile DBFile_Notifications is not created in the current server hence the issue. I have created the account in msdb.dbo.sysoperators table and it works fine.

declare @email_address varchar(100)
select @email_address =email_address from msdb.dbo.sysoperators where name='DBFile_Notifications'

exec msdb.dbo.sp_send_dbmail 
@profile_name = 'JobMail',
@subject='Job Alert: CheckDBFileSize: CheckForExtendedFiles',
@body = @tableHTML,
@body_format = 'HTML' ;

No comments:

Post a Comment