Is there an equivalent to SQL Server's SET NOCOUNT in MySQL?

nbnkbykc  于 2023-04-10  发布在  SQL Server
关注(0)|答案(3)|浏览(136)

Does MySQL have an equivalent to SQL Server's SET NOCOUNT ON statement?

fykwrbwg

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();
atmip9wb

atmip9wb2#

There is no equivalent as far as I am aware.

9vw9lbht

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

相关问题