Does MySQL have an equivalent to SQL Server's SET NOCOUNT ON statement?
SET NOCOUNT ON
fykwrbwg1#
The SET NOCOUNT ONstops the message indicating the number of rows affected by a Transact-SQL statement from being returned as part of the results .
MySQL doesn't report the number of rows affected by a query, therefore there's no such function.
You can if you like find out about the number of affected rows using the ROW_COUNT() function, right after your query:
DELETE FROM mytable WHERE name="John"; SELECT ROW_COUNT();
atmip9wb2#
There is no equivalent as far as I am aware.
9vw9lbht3#
My SQL doesn't have any equivalent of SET NOCOUNT ON
Read this officially answered on MySQL https://forums.mysql.com/read.php?98,646095,646181#msg-646181
3条答案
按热度按时间fykwrbwg1#
The
SET NOCOUNT ON
stops the message indicating the number of rows affected by a Transact-SQL statement from being returned as part of the results .MySQL doesn't report the number of rows affected by a query, therefore there's no such function.
You can if you like find out about the number of affected rows using the ROW_COUNT() function, right after your query:
atmip9wb2#
There is no equivalent as far as I am aware.
9vw9lbht3#
My SQL doesn't have any equivalent of SET NOCOUNT ON
Read this officially answered on MySQL https://forums.mysql.com/read.php?98,646095,646181#msg-646181