加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > MsSql教程 > 正文

sqlserver bcp

发布时间:2020-12-12 13:38:02 所属栏目:MsSql教程 来源:网络整理
导读:EXEC master..xp_cmdshell ' BCP "select * from testad.dbo.Test" queryout d:tset1.txt -c -U"sa" -P"sasasa" ' -- 导出数据到tset2.xls,使用-T信任连接 -- 通过-F 10 -L 13 指定导出的起始行和结束行数 EXEC master..xp_cmdshell ' BCP "select * from t

EXEC master..xp_cmdshell 'BCP "select * from testad.dbo.Test" queryout d:tset1.txt -c -U"sa" -P"sasasa"'

--导出数据到tset2.xls,使用-T信任连接--通过-F 10 -L 13 指定导出的起始行和结束行数

EXEC master..xp_cmdshell 'BCP "select * from testad.dbo.Test" queryout d:test2.xls -c -F 10 -L 13 -T"'

--使用in语句来将数据导入到数据表

EXEC master..xp_cmdshell 'BCP te.dbo.Test in D:test2.xls -c -T'

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读