How to resolve Error 22051?
Jobs failed with below error message.
Executed as user: XXXXXX-svc. Mail queued. [SQLSTATE 01000] (Message 0) File attachment or query results size exceeds allowable value of 1000000 bytes. [SQLSTATE 42000] (Error 22051). The step failed.
Go to Database Mail under Management in Sql Server Management Studio -->Select Configuration Task as View or Change system parameters -->Give Maximum File Size (Bytes) as to 1.5 million
Now mail sending commands in the job will execute successfully.