2021年3月9日星期二

Can't insert rows into SQL Server table that contains triggers ( F Sharp SQL Provider )

I am using the Sqlprovider driver and hitting an issue on creating new records - that appears to make the driver useless.

        let foundProductMaybe = query {              for p in ctx.Dbo.Products do              where (p.DefaultSupplierSku.Value = pl.supplierSku)              select (Some p)              exactlyOneOrDefault          }          match foundProductMaybe with              | Some foundProduct ->                  updateProduct(foundProduct,pl,ctx)              | None -> addProduct(pl, ctx)          product.Id <- Guid.NewGuid()          product.Code <- "some code"          .... etc           ctx.SubmitUpdates()  

I get the error:

System.Data.SqlClient.SqlException: 'The target table 'dbo.Products' of the DML statement cannot have any enabled triggers if the statement contains an OUTPUT clause without INTO

Is there a workaround for this?

https://stackoverflow.com/questions/66558122/cant-insert-rows-into-sql-server-table-that-contains-triggers-f-sharp-sql-pro March 10, 2021 at 11:55AM

没有评论:

发表评论