So Scope_Identity() returns an ?-Byte Numeric Type in SQL Server.
That is not awesome.
Is there a safe way to cast it to an int in a select query so we don't have to manage every whim of SQL Server in our ODBC Wrapper?
SELECT CAST( bigintcolumn AS int )
(Provided you know it will fit into a 32bit integer)
Just cast this like:
select CAST(SCOPE_IDENTITY() as int)
And your data Layer:
reader.GetInt32(0);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With