您的位置:首页 > 其它

用BCP命令 导入导出数据

2010-11-15 15:07 253 查看
要使用..xp_cmdshell,首先要打开高级选项,命令如下:

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

--导出

EXEC master..xp_cmdshell 'bcp ksoacc.dbo.lsdtxb out Currency.dat -c -S"wby-pc\yy" -U"sa" -P"1" '

--导入

EXEC master..xp_cmdshell 'bcp ksoacc.dbo.lsdtxb1 int Currency.dat -c -S"wby-pc\yy" -U"sa" -P"1" '
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: