November 28, 2023 at 5:05 pm
This is strange, any SQL job that sends out Emails via 'msdb.dbo.sp_send_dbmail ' are failing with this weird execution user. Executed as user: User Manager\ContainerAdministrator. Failed to initialize sqlcmd library with error number -2147467259. [SQLSTATE 42000] (Error 22050). The step failed.
It doesn't matter if I change the SQL Owner to 'SA', to a AAD Account. This randomly started happening. If a SQL Mail is sent via a stored proc method, no issues.
What could have changed in my SQL MI environment to trigger this?
Thanks,
Daniel
November 28, 2023 at 8:53 pm
A 'workaround' was to add: execute as login = 'SQLLoginAccount ' in all the SQL Jobs that calls EXEC msdb.dbo.sp_send_dbmail in it. That did the trick but not sure what triggered the change in SQL MI (2 enviornments) but not the 3 one. To start executing the SQL Jobs as 'Executed as user: User Manager\ContainerAdministrator'. We don't use any type of Containers.
November 28, 2023 at 8:53 pm
A 'workaround' was to add: execute as login = 'SQLLoginAccount ' in all the SQL Jobs that calls EXEC msdb.dbo.sp_send_dbmail in it. That did the trick but not sure what triggered the change in SQL MI (2 enviornments) but not the 3rd one. To start executing the SQL Jobs as 'Executed as user: User Manager\ContainerAdministrator'. We don't use any type of Containers.
May 29, 2024 at 10:53 am
This just started to happen to us, exact same user failing when trying to send directly calling sp_send_dbmail, not via a sproc.
June 27, 2024 at 9:21 pm
Yeah, got it working by creating a SQL Login and then adding: execute as login = 'NewLogin' before the step runs.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply