首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > 其他数据库 >

应用bcp命令导出数据

2012-08-15 
使用bcp命令导出数据第一步执行如下代码打开xp_cmdshell 一般是禁用的EXEC sp_configure show advanced o

使用bcp命令导出数据

第一步执行如下代码  打开xp_cmdshell 一般是禁用的

EXEC sp_configure 'show advanced options', 1;RECONFIGURE;EXEC
 sp_configure 'xp_cmdshell', 1;RECONFIGURE;

 

 

sql2008 导出数据

EXEC master..xp_cmdshell 'BCP busonline.dbo.dmt_dqdm out d:\as.txt -c -S "WORK2-PC\WORK2" -U "sa" -P "123456"'

 

导入数据

EXEC master..xp_cmdshell 'BCP busonline.dbo.dmt_dqdm in d:\as.txt -c -S "WORK2-PC\WORK2" -U "sa" -P "123456"'

 

 

这样就ok 了

 

热点排行