Mssql insert failing

when trying to insert a record on mssql database I am getting this error:

  • statusCode:422
  • error:"Unprocessable Entity"
  • message:"insert into [dbo].[tableName] ([DESCATTIVITÀSVOLTA], [DURATAMINUTI], [FKEYATTIVITÀGIORNALIERA], [FKEYATTIVITÀMONITORATA], [FKEYCANTIERE], [ORAINSERIMENTO]) output inserted.* values (@p0, @p1, @p2, @p3, @p4, @p5) - The target table 'dbo.tableName' of the DML statement cannot have any enabled triggers if the statement contains an OUTPUT clause without INTO clause."
  • data:null
  • :arrow_forward:

queryExecutionMetadata:{} 5 keys

  • estimatedResponseSizeBytes:475
  • resourceTimeTakenMs:2668
  • isPreview:false
  • resourceType:"mssql"
  • lastReceivedFromResourceAt:1702434069420

Hey @mpmohi! Can you share the query that you are using in Retool? Is this a GUI mode query?

hi, sent you screenshots,

@mpmohi Thanks for the screenshots, that is a GUI mode query. Unfortunately, GUI mode queries do not work with MSSQL tables that have triggers. You would need to switch to using a raw SQL query to get this insert to work.

2 Likes

Thank you for your response, Now I am getting:
"The INSERT permission was denied on the object 'MY_Table', database 'MyDB', schema 'myschema' " I guess this is happening as user does not have proper permission and nothing to do with retool , right ?

@mpmohi Yes, that error generally implies that the db user does not have the proper permissions to run insert queries on that table. You should be able to update the permissions on the db side.