As the error message says, the setting ANSI_PADDING must be ON for certain features.
If this did not happen in dev or staging, it could because the setting was ON in these environments. It could also be that no feature that requires ANSI_PADDING to be on is present in these environments.
These features requires ANSI_PADDING to be ON:
- Indexed views.
- Indexes on computed columns.
- Filtered indexes.
- XQuery and xml type methods.
- Spatial indexes.
Note that the error occurs at compile time, so if the procedure sp_MSins_dboORC_MTL_ONHAND_QUANTITIES_1 has a statement that makes an update to a table with, say, a filtered index, you will get this error, even if the logic in the procedure precludes this statement from being executed.
The setting ANSI_PADDING OFF is a legacy setting, which should be avoided. The default setting is ON.
ANSI_PADDING can be OFF because you have executed the statement SET ANSI_PADDING OFF. If so, stop doing that.
But the setting is also saved by table columns of the types varchar and varbinary. You can use this column to find if you any such columns in your database:
SELECT s.name AS SchemaName, o.name AS TableName, c.name AS ColumnName
FROM sys.columns c
JOIN sys.objects o ON c.object_id = o.object_id
JOIN sys.schemas s ON s.schema_id = o.schema_id
WHERE type_name(c.system_type_id) LIKE 'var%'
AND c.is_ansi_padded = 0