--测试,先将SQLServer数据导出到文本文件
exec master..xp_cmdshell 'bcp "select OrderID,EmployeeID from Northwind..Orders" queryout d:\t.txt -c -t, -r\r\n -Usa -Padmin'
--在MySQL里新建一个表
create table tb(
OrderID varchar(10),
EmployeeID int
);
--再用Load ... Infile语句导出
load data infile 'd:\\t.txt'
into table tb
fields
terminated by ','
enclosed by '\n'
--查看是否已经导入
select * from tb;
--现在再实现MySQL备份导入SQLServer
--MySQL实现备份
select * into outfile 'd:\\tt.txt'
fields
terminated by ','
enclosed by '\n'
from tb;
--导入到SQLServer
--导入测试失败..由于MySQL生成的文件编码问题..
可以使用DTS..
也可以试试这个mssql2mysql