Microsoft SQL Server 2012- Can update multiple rows, but not a single row?

Viewed 27

So I am trying to UPDATE in SQL Server 2012. But every UPDATE statement I run, it seems to update everything except for the last item? It's EXTREMELY weird.

So If I run:

UPDATE package_table
SET status = 'SHIPPED'
WHERE package_number IN ('111','222','333','444');

Expected output: 
(4 row(s) affected)

Actual output:
(1 row(s) affected)
(4 row(s) affected)

And then when I check the data, all are updated except for the last one (so 111, 222, and 333 will now have their status as 'SHIPPED' but 444 will not!)

I don't know why the output is doing that extraneous (1 row(s) affected) before the proper (4 rows(s) affected), and I don't know why the last item isn't getting updated.

This is true even if I try to update only one row:

UPDATE package_table
SET status = 'SHIPPED'
WHERE package_number = '111';

Expected output: 
(1 row(s) affected)

Actual output:
(1 row(s) affected)
(1 row(s) affected)

Anyone have a clue as to what's going on? Clearly I have UPDATE permissions, as I'm able to update some of the rows when I try to do several at once.

0 Answers
Related