Failed to initialize sqlcmd library with error number -2147467259

INDHUJA V 20 Reputation points
2023-06-20T06:00:37.3133333+00:00
EXEC msdb.dbo.sp_send_dbmail	
  @profile_name                   = 'xxx_xxx_email',        
   @recipients                     = '******@gmail.com', 
   @subject                        = 'DQ',
   @body                           = 'AA', 
   @body_format                    = 'TEXT', 
   @importance                     = 'NORMAL',
   @sensitivity                    = 'NORMAL',
   @file_attachments               = NULL,  
   @query                          = 'SET NOCOUNT ON; select 1 as q',
   @execute_query_database         = 'cfr_rct_01',  
   @attach_query_result_as_file    = 1,
   @query_attachment_filename      = 'xl',  
   @query_result_header            = 1,
   @query_result_width             = 32767,            
   @query_result_separator         = '.',
   @exclude_query_output           = 0,
   @append_query_error             = 0

the code is generating Msg 22050, Level 16, State 1, Line 0
Failed to initialize sqlcmd library with error number -2147467259. error
SQL Server Other
{count} votes

Accepted answer
  1. Anonymous
    2023-06-20T06:39:58.3833333+00:00

    Hi @INDHUJA V

    You can refer to this post for troubleshooting.

    https://www.mssqltips.com/sqlservertip/5552/troubleshooting-sql-server-spsenddbmail-error-failed-to-initialize-sqlcmd-library/

    Best regards,

    Percy Tang


    If the answer is the right solution, please click "Accept Answer". If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.