将SQL查询输出到文本文件

编程入门 行业动态 更新时间:2024-10-11 23:20:27
本文介绍了将SQL查询输出到文本文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

如何将SQL查询的结果写入文本 文件? 我在在线帮助文​​件中找不到任何信息。 例如,我想得到的结果: SELECT *来自TableA 要写入文件result.txt Alex

Hi, How would I go about writing the results of an SQL query to a text file? I cannot find any info in the Online help files. For example, I would like the results of: SELECT * FROM TableA To be written to the file result.txt Alex

推荐答案

打开查询分析器。转到查询并选择结果到文件....和 执行期间,它将提示文件名.... Open query analyzer. Go to Query and select Result to file.... and during execution, it will prompt a file name....

谢谢,但我不能这样做。 这个必须查询必须对最终用户不可见。 例如,如果a用户在我的系统上执行某些功能,我希望对他们选择的内容执行查询并将结果输出到 文件。我不希望我的用户选择另存为等。 Thanks but I cannot do that. This must query must be invisible to the end user. For example, if a user performs some function on my system, I wish to execute a query on what they have selected and output the results to a file. I do not want my user to be selecting Save As etc..

首先你的问题不明确。我仍然不确定你是什么 试图完成。 首先,如果你有一个你不希望你的用户知道的查询,请将其包裹起来 在存储过程中将其安排在工作中并让用户执行 工作。 另一个简单的方法是创建一个dts并让用户运行dts, 应该运行查询并输出文件。 希望这有助于..! First your question is not clear. I am still not sure what you are trying to accomplish. First if you have a query that you dont want your user to know, wrap it up in a stored proc and schedule it in a job and let the user execute the job. Another easy way is to create a dts and let the user run the dts that should run the query and output the file. Hope this helps..!

更多推荐

将SQL查询输出到文本文件

本文发布于:2023-11-24 05:57:12,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1624167.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文本文件   SQL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!