读书人

SQLServer运用BCP导入导出数据

发布时间: 2012-08-07 14:54:48 作者: rapoo

SQLServer使用BCP导入导出数据

命令行下:

bcp pubs.dbo.table1 in "d:\\t1.dat" -S . -U "sa" -P "123" -n

bcp pubs.dbo.table1 out "d:\\t1.dat" -S . -U "sa" -P "123" -n

或调用SQL过程

exec master..xp_cmdshell 'bcp pubs.dbo.table1 in "d:\\t1.dat" -S . -U "sa" -P "123" -n'exec master..xp_cmdshell 'bcp pubs.dbo.table1 out "d:\\t1.dat" -S . -U "sa" -P "123" -n'

msdn:http://msdn.microsoft.com/zh-cn/library/ms162802.aspx

读书人网 >SQL Server

热点推荐