Where does SP _ send _ dbmail execute from Job fails?

Where does SP _ send _ dbmail execute from Job fails?

The step of job that contains call to sp_send_dbmail runs under the same DOMAIN\\User. Also I’ve traced that when running the query part of sp_send_dbmail it tries to execute exec xp_logininfo ‘DOMAIN\\User’ to check against Active Directory if that user is OK. And surprise: something is definitely not OK. This check ends up with:

Can a linked server be reached under a service account?

As such the linked server is not reached under the service account, but under an impersonation context of the application connected (DatabaseMail90.exe), which happens to be the same account as the service account.

Why do I keep getting error messages in SQLCMD?

I tried to recreate what they were doing, but I was getting this error message “Msg 22050, Level 16, State 1, Line 0 Failed to initialize sqlcmd library with error number -2147467259”. I could send an email without an issue using sp_send_dbmail, but whenever I tried to include a query I kept getting the error message.

What is OLE DB provider for linked server?

OLE DB provider “SQLNCLI10” for linked server “LINKEDSERVERA” returned message “A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correc t and if SQL Server is configured to allow remote connections.

Where does SP _ send _ dbmail return the mailitem ID?

When mail is successfully placed in the Database Mail queue, sp_send_dbmail returns the mailitem_id of the message. This stored procedure is in the msdb database.

Is there a problem with the SQL Agent?

If yes… then Security permission issues are there .. The problem with the SQL Agent is that it runs under an account which does not have the same privileges than the user using the SQL Server Management Studio (usually a Windows Administrator or a user with higher privileges).

What does MSG 15404 mean in SQL Server?

And surprise: something is definitely not OK. This check ends up with: Msg 15404, Level 16, State 19, Server SQLC002INS02\\SQLC002INS02, Line 1 Could not obtain information about Windows NT group/user ‘DOMAIN\\User.’, error code 0x2.