sql导入excel

两个步骤

第一、设置外围应用配置器

进入 - 功能的外围应用配置器 - xp_cmdshell 启用

第二、利用BCP,如下例语句

EXEC master..xp_cmdshell 'BCP "select title, CONVERT(varchar(12) , times, 111 ) as times from information.dbo.information where [type]=7" queryout c:\abc.xls -c -U"sa" -P"123"'

posted @ 2012-12-28 16:57  RyanRuan  阅读(268)  评论(0编辑  收藏  举报
View Code