将数据从SQL 2005导出到Sql查询中的Csv文件 [英] Export Data From SQL 2005 To Csv File From Sql Query

查看:161
本文介绍了将数据从SQL 2005导出到Sql查询中的Csv文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我想从单个查询将Sql 2005表中的所有数据导出到Csv文件.
请帮帮我.

谢谢

Rohit Sharma

Hello,

I want To Export All Data From Sql 2005 Table To Csv file from single query.
Please Help me.

Thanks

Rohit Sharma

推荐答案

有一组存储过程在这里 [ ^ ]执行此操作给你的.

SQL管理工具为表提供了导出到CSV"选项,您无需使用该表就可以编写单个查询.
There are a set of stored procedures here[^] that do this for you.

The SQL Management tool offers an export to CSV option for a table using which you dont need to write a single query.


如果必须在SQL Server中执行此操作,则:
1)打开SQL Management Studio
2)右键单击数据库名称,然后选择工具...导出数据"
3)在选择来源"对话框中按下一步"
4)在选择目标"对话框的目标"下拉列表中选择平面文件"
5)在文件名"框中输入文件名和路径.
6)选中第一个数据行中的列名"框.
7)按下一步",然后按照说明进行操作.
If you have got to do this within SQL server, then:
1) Open SQL Management studio
2) Right click the database name, and select "Tools...Export data"
3) Press "Next" in the "Select Source" dialog
4) Select "Flat File" in the "Destination" drop down of the "Select Destination" dialog
5) Enter a file name and path in the "File name" box.
6) Tick the "Column names in first data row" box.
7) Press Next, and follow the instructions.


这篇关于将数据从SQL 2005导出到Sql查询中的Csv文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆