Failed to initialize sqlcmd library with error number -2147467259.

While sending the mail through SQL Server using DBMail, sometimes we get the error message “Failed to initialize sqlcmd library with error number -2147467259”. This is because there is an issue with the execution. The possible scenarios are given below –

1) SQLCMD is unable to execute the code because it doesn’t know in which database the code needs to be executed

2) Invalid table name

3) Invalid column names

Check the code and correct the name of the table or column for the second and third reasons.

For the first reason, use three-part name in your SELECT statement
(Eg. DBName.dbo.TableName).
Otherwise use the input parameter “@execute_query_database”
(Eg. @execute_query_database = ‘YourDBName’).

Do let me know if you are still facing the same error.

One comment

  1. Pingback: Homepage

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s