Trying to send out a simple data set from SQL. I have used this before on another server in the past with no issue. My script
EXEC msdb.dbo.sp_send_dbmail
@profile_name = '**** DB Mail',
@recipients = '*****@*****.com',
@subject= 'Customer',
@query = N'select CustNum,Name,Addr_1,Addr_2,Addr_4,City,State,Zip,County,Country
from _customer',
@attach_query_result_as_file = 1 ;
I have tested and verified that SQL mail itself works just fine. (SQL 2016)
the error that I get
Msg 22050, Level 16, State 1, Line 0 Failed to initialize sqlcmd library with error number -2147467259.
Completion time: 2024-02-26T10:15:21.7817853-08:00
I have tried everything that I have seen online
Thanks, Sean
checked my permissions, checked that SQL sent mail works. It's a simple script and works fine by itself.