Home Dashboard Directory Help
Search

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


Status: 

Active


1
0
Sign in
to vote
Type: Bug
ID: 841267
Opened: 3/26/2014 10:08:12 AM
Access Restriction: Public
1
Workaround(s)
view
0
User(s) can reproduce this bug

Description

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.
Details
Sign in to post a comment.
Sign in to post a workaround.
Posted by kondordaniel on 3/26/2014 at 10:10 AM
Use the following statement after executing a query the get the actual number of rows affected:
select rowcount_big()