SQLProvider
SQLProvider copied to clipboard
Server-side column values not retrieved when record inserted or updated
Description
(MS SQL SERVER) I have many tables with TIMESTAMP columns, computed columns, columns with default values. Most of the tables have auto-incremented (identity) primary key.
I expect that entity will contain those values after record is created or updated.
When I save (create or update) the entity it doesn't query values of such columns.
Expected behavior
All server-side values retrieved on INSERT and UPDATE, not just auto-increment primary key on INSERT. Should be easy to implement using "INSERT ... OUTPUT" or "UPDATE ... OUTPUT" synthax
Actual behavior
At the moment SQLProvider updates only auto-incremented primary key for new entities (generated SQL is "INSERT ... OUTPUT ..." )
Known workarounds
- re-query entity after it is inserted or updated (ugly)
- create a stored proc instead
Related information
- Used database: MS SQL Server (14.0.2014.4)
- Operating system: Windows 10
- .NET Core 2.1
We have the exact same problem. Sad to see no progress on this issue. @DunetsNM how did you work around this?
@tskj I didn't find a workaround, ended up with different type provider (FSharp.Data.SqlClient) which is very different by design to make a fair comparison with this one, it embraces raw T-SQL instead of abstracting away from it. Worked alright for my use cases.