Sql server导出查询结果以使用列名而不是数据进行优化。 [英] Sql server export query results to excel with column names but not data.
本文介绍了Sql server导出查询结果以使用列名而不是数据进行优化。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
SQL Server Export Query Results to Excel with Column Names but not data.
我尝试过:
What I have tried:
SQL Server Export Query Results to Excel with Column Names but not data.
推荐答案
首先想到的问题是为什么会以任何方式需要?
嗯,有一种方法可以解决所有问题,如果有这些帮助,请检查以下方法 -
---用标题导出结果并删除数据行
---使用条件在WHERE
子句中,它将被评估为false,以确保您不会获得任何数据行和标题。
类似于 -
The question that comes in to mind first is "Why would that be needed any way?"
Well, there is a way for everything, check following approaches if these help-
---Export the result with header and remove the data rows
---Use a condition inWHERE
clause which will be evaluated to false always so as to make sure you will not get any data rows and just the headers.
Something like -
SELECT * FROM MyTable WHERE 1<>1
希望,它有助于:)
Hope, it helps :)
这篇关于Sql server导出查询结果以使用列名而不是数据进行优化。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文