SmartConnect Error: “The delete permission was denied on the object…”

Microsoft Dynamics 365 Business CentralA while back a client using SmartConnect reported an error running one integration; this is one of a set of newly created identical integrations running against a set of companies, but only one of them was failing.

The error produced was:

SmartConnect error

Task xxxx failed. Map run will end reporting failure. The DELETE permission was denied on the object 'xxxx', database 'xxxx', schema 'dbo'

As there was a reference to permssions, I assumed there would be a SQL issue; when looking through database permissions, I found that in one database the user account used by SmartConnect had the db_denydatawriter role membership assigned:

Database User permissions

Once this permission was removed, the integration ran successfully.