Why does select SCOPE_IDENTITY() return a decimal instead of an integer?

后端 未结 4 1286
野性不改
野性不改 2020-11-27 05:10

So I have a table with an identity column as the primary key, so it is an integer. So, why does SCOPE_IDENTITY() always return a decimal value instead of an int

4条回答
  •  长情又很酷
    2020-11-27 06:16

    Scope identity return value is decimal(38,0)

    CAST it, use the OUTPUT clause, or assign to an output parameter rather than SELECT SCOPE_IDENTITY() to the client

提交回复
热议问题