error on sending mail.

SVA 116 Reputation points
2023-05-11T12:46:18.78+00:00

Hi,

Getting below error while executing from SQL Server Jobs. But when I run from SSMS query window no error showing.

Please help me on this to get rid of.

Message

Executed as user: BEIN\SBSSQLA$. Failed to initialize sqlcmd library with error number -2147467259. [SQLSTATE 42000] (Error 22050). The step failed.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,992 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Erland Sommarskog 112.7K Reputation points MVP
    2023-05-11T21:27:19.56+00:00

    Since you did not show us the code you are using, you left us in the bit of the dark. But this post seems to discuss this error, with the very same error code: https://www.mssqltips.com/sqlservertip/5552/troubleshooting-sql-server-spsenddbmail-error-failed-to-initialize-sqlcmd-library/, so try that.

    0 comments No comments

  2. PercyTang-MSFT 12,501 Reputation points Microsoft Vendor
    2023-05-12T02:28:08.55+00:00

    Hi @SVA

    You can also refer to this post.

    https://databasemath.com/2021/08/27/mssql-database-mail-failed-to-initialize-sqlcmd-library-with-error-number-2147467259/

    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

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.