我尝试使用 OSQL 将查询结果保存在文本文件中,然后将这些文本文件批量插入到表中。 OSQL部分没问题,但是,在批量插入中,查询结果末尾受影响的行数会导致错误。这是一个例子;
select item_number, description, price from item
3536114 Fruit mix $3.99
3536229 DO 20 liquid $9.99
3536251 Peppermint $7.99
(3 rows affected) ------> I do not need this line.
最佳答案
使用SET NOCOUNT
像这样:
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.
关于sql - 当我运行简单的选择查询时,是否可以不显示最后受影响的行数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13257860/