I'm trying to execute the following:
msdb.dbo.sp_send_dbmail --@body='Hi from sql server in a sproc' @query='select 1' ,@recipients='mkohn@***.com' ,@subject = 'Test'
When I uncomment
@body line, and comment the
query... line it works.
With the query it returns:
Msg 22050, Level 16, State 1, Line 0 Failed to initialize sqlcmd library with error number -2147467259.
I have a developer edition on my own workstation and it all works no problem
- Installing .Net 3.5
- Adding myself to db_owner and [DatabaseMailUserRole]
- Adding [NT Service\MSSQLSERVER] to db_owner and [DatabaseMailUserRole]
- Same as above with [NT SERVICE\SQLSERVERAGENT]