簡體   English   中英

SQL Server算術溢出錯誤將IDENTITY轉換為數據類型int但尚未達到int的最大值

[英]SQL Server Arithmetic overflow error converting IDENTITY to data type int but haven't reached max of int

我正在使用具有數據類型為INT的PK的表。 該列的“Identity Increment”設置為1,“Identity Seed”設置為1。

我正在嘗試插入並收到以下錯誤:

Msg 8115, Level 16, State 1, Line 3
Arithmetic overflow error converting IDENTITY to data type int.
Arithmetic overflow occurred.

當我運行以下內容以查看我得到的最大ID是1702747645:

SELECT Max(Id) FROM Log_Records

Int假設上限為2,147,483,647,所以我想知道為什么我會收到這個錯誤?

嘗試運行DBCC CHECKIDENT ('Log_Records', NORESEED);

這將報告指定表中的當前標識值。 下一個標識值不必與表中的最大值一致,例如,如果您有已回滾的事務。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM