The return type for both builtins is numeric(38,0) (which is converted to decimal in c#) but there is no decimal handler in DapperTypeHandler.Parse. You can currently get around this by adding CAST(SCOPE_IDENTITY() AS INT) but this is not ideal if you have a lot of queries that return that identity value.
In MSSQL
SCOPE_IDENTITY()
and@@IDENTITY
must encompass several numeric types for table ids.https://learn.microsoft.com/en-us/sql/t-sql/functions/scope-identity-transact-sql?view=sql-server-ver16
The return type for both builtins is
numeric(38,0)
(which is converted to decimal in c#) but there is no decimal handler inDapperTypeHandler.Parse
. You can currently get around this by addingCAST(SCOPE_IDENTITY() AS INT)
but this is not ideal if you have a lot of queries that return that identity value.