Show in output rows retrieved/affect for each executed query
Hi, when running the following code:
UPDATE Game
SET Played = 1
WHERE Genre = 'FPS'
UPDATE Game
SET Played = 1
WHERE Title = 'Factorio'
Services/Output tab will return “667 rows affected”, where 667 is a sum of all affected rows. If I'd run SELECT for these conditions I'd only receive information that “1 row retrieved” (only the last UPDATE). Is it possible to change this behavior to show rows affected/retrieved for each individual statement (e.g. SQL Server Management Studio shows it this way, displaying separate messages for 666 and 1 row).
请先登录再写评论。
Hi,
Am I correct that, in your case running, the two updates above resulted in a total count of affected rows of both tables written into the output? I tested a similar case and got two separate counts of affected rows when running an Update statement over two different tables
Hi, thanks for checking. This might be the thing w/ SQL Server only. By default the results will be as I've described above. However adding GO b/w the updates solves this issue:
W/o GO:
Likewise SQLite does it by default:
So far I don't see any option to change that behavior in SQLServer, so maybe that's just how it is currently.