SSMS displays number of affected rows incorrectly if the value overflows a 32-bit signed integer - by kondordaniel

Status : 


Sign in
to vote
ID 841267 Comments
Status Active Workarounds
Type Bug Repros 0
Opened 3/26/2014 10:08:12 AM
Access Restriction Public


When executing a query which affects over 2^31 rows, the message displaying the number of rows affected (i.e. the text in the 'Messages' pane) displays incorrect information. The actual value is truncated to 32-bits and interpreted as a signed integer. If this value is negative (e.g. the actual number of rows affected is between 2^31 and 2^32), no number, only the text 'Command(s) completed successfully.' is displayed. If the value is positive, the truncated value is displayed (e.g. 1073741824 /2^30/ instead of 5368709120 /5*2^30/ ).
This does not affect the results of the query, the results are correct (e.g. in the case of an INSERT, more than 2^31 rows can be inserted without problems), only the displayed information is incorrect. Also, the function ROWCOUNT_BIG() return the correct value.
Sign in to post a comment.