求SQL语句 - MS-SQL Server / 基础类
数据库表名student_info 使用查询语句select * from student_info;求SQL语句使得在查询分析器中所得到的数据导出成为一张EXCEL或者是CSV、TXT格式的文件到C:\student 下;
BCP 导入导出功能
EXEC master..xp_cmdshell 'bcp "select * from student_info" queryout C:\student\student_info.txt -c -Sservername -Usa -Ppassword'
学习了~
晕 看来我得找相干资料学习下才行、、
EXEC master..xp_cmdshell 'bcp "select * from student_info" queryout C:\student\filename.xls -c -Sservername -Usa -Ppassword'
谢小F资料
up.........
相关问答:
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jas ......
如何在SQL2005中设定定时作业,比如说定时清理某些表的数据,
或者是定时的将某些表的数据导出excel!
在线等待,急急急,最好是详细步骤!
之前我做的作业有点问题!
帮UP
参考:http://hi.baidu.com/toiota ......
字段1,字段2.....字段N,Status,ParentID
1,Name1....test1,1,99
1,Name1....test1,3,99
1,Name2....test2,1,101
1,Name2....test2,3,101
1,Name3....test3,2,101
1,Name1....test1,4,101
想要的结果是:
1,Na ......
表数据
COL1 COL2 COL2 COL4 COL5
----------------------------------------------------------------------------------------------
2010-05-05 00:00 ......
通过NAME字段条件查询一个数据表,假设我有100个姓名,有以下两个方法,
方法1:
把100个Name 组成一个SQL语句,比如 Select * from tmp_table where Name='张三' or Name ='李四' Or ...Or Name='第一百个姓名'
......