Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
rahul170
Starting Member
3 Posts |
Posted - 2009-02-18 : 07:44:50
|
We have an automated job scheduled at clients’s databases on Sql Server 2005. The job runs some validation scripts and sends results of the scripts via email. For one client the job is running perfectly but on another client, it is giving following error:Msg 22050, Level 16, State 1, Line 0Error executing extended stored procedure: Invalid ParameterBelow is the script which runs as scheduled job:declare @mail_list varchar(100)set @Mail_list = 'abc@xyz.com'EXEC msdb.dbo.sp_send_dbmail@profile_name = 'Email_ProfileName', @recipients = 'abc@xyz.org',@copy_recipients = @Mail_list,@query = 'EXEC TPRO.dbo.Data_Check_Notification_Procedure_SP',@subject = 'Subject',@body = 'Body Text',@attach_query_result_as_file = 1, @query_attachment_filename ='Validation_Results.txt' ;I tried running the following script:EXEC msdb.dbo.sp_send_dbmail @profile_name = 'EMAIL_ProfileName', @recipients='abc@xyz.com', --@query = 'select getdate()', @body = 'Hello', @body_format = 'TEXT', @subject = 'Subject'If I comment @query parameter in the query above, it runs fine. But running the query with @query parameter gives the same error.We have tried to run the job using both Windows authentication and SQL authenticationIs there any permissin related problem?Any help on this topic will be highly appreciated |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
|
|
|
|