I created a new email profile with the super admin and I configured the smtp.
Then when I execute this query:
exec msdb.dbo.sp_send_dbmail
@profile_name ='admin_mail',
@recipients = '[email protected]',
@execute_query_database = 'DashboardPowerBi',
@query = 'select top 20 from Client_1',
@subject= 'Liste des clients',
@body_format ='HTML',
@attach_query_result_as_file = 1;
I get this error:
Failed to initialize sqlcmd library with error number -2147024809
Recently i had an issue related with this, the solution here was to fully qualified the DATABASE + SCHEMA_NAME + TABLE_NAME ('select * from sales..sales_month'), even if you're in the same database.
Regards!
Well, the query is incorrect. You need to specify which columns you are selecting
@query = 'select top 20 * from Client_1',
But rather than using '*', actually list the columns you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With