SQL导出到文本:
exec master..xp_cmdshell ' bcp "库名..表名" out "文件路径和名称" -c -U "用户名" -P "密码" '
例如:
exec master..xp_cmdshell ' bcp "Northwind..Region" out "d:\tt.txt" -c -U "sa" -P "sa" '
SQL文本导入到表
exec master..xp_cmdshell ' bcp "库名..表名" in "文件路径和名称" -c -U "用户名" -P "密码" '
例如:
exec master..xp_cmdshell ' bcp "Northwind..tb" in "d:\tt.txt" -c -U "sa" -P "sa" '

| ©2003-2008 Woody. Some Rights Reserved. Feed - Sitemap - Valid XHTML - Valid CSS - Creative Commons Powered by ABlog v3.2. Skin Reserved by Default | Processed in 0.031250 Seconds. 4 Queries | 浙ICP备07029590号 |