简体   繁体   English

SQL Server 2008 R2 Express删除输出文件中的页脚

[英]SQL Server 2008 R2 Express Remove footer in output file

I'm using SQL Server SSMS to output a query to a space delimited text file. 我正在使用SQL Server SSMS将查询输出到以空格分隔的文本文件。 It works fine with one exception. 它工作正常,但有一个例外。 At the bottom of the file it prints a message about how many lines it printed just like when the query is routed to the results grid in SSMS : 在文件的底部,它将显示一条有关打印了多少行的消息,就像将查询路由到SSMS的结果网格时一样:

  id         sales       region
 001          100,000       North
 001          100,000       North
 001          100,000       North
 001          100,000       North
 001          100,000       North
 ...             ...         ...


(78482 row(s) affected)

This is a problem as there are multiple files and they are read into another program where this message causes an error. 这是一个问题,因为有多个文件,并且它们被读入另一个程序,此消息会导致错误。

I've looked around in the output and query options but don't see any way to fix this. 我在输出和查询选项中四处查看,但是看不到任何解决方法。

Any suggestions? 有什么建议么?

set nocount on in the beginning of the query/inputfile. 在查询/输入文件的开头set nocount on

Stops the message that shows the count of the number of rows affected by a Transact-SQL statement or stored procedure from being returned as part of the result set. 停止显示返回Transact-SQL语句或存储过程影响的行数计数的消息作为结果集的一部分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM