mysql 导入sqlserver数据库
Posted tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mysql 导入sqlserver数据库相关的知识,希望对你有一定的参考价值。
#mysql 导入sqlserver数据库
EXEC master.dbo.sp_addlinkedserver @server = N‘sjkxb00‘, @srvproduct=N‘mysql‘, @provider=N‘MSDASQL‘, @provstr=N‘DRIVER={MySQL ODBC 5.3 Unicode Driver}; SERVER=localhost; _DATABASE=tigerdb; USER=root; PASSWORD=123456; OPTION=3‘ --数据导入到 loreal 数据库中 --cast(null as bigint) as Id select identity(bigint,1,1) as Id,* into loreal.dbo.Comments from openquery(sjkxb00, ‘SELECT * FROM loreal.t_comment_5927833634809674453‘) --数据导入到 wmm 数据库中 select -- top 5 * identity(bigint,1,1) as Id,* into wmn.dbo.t_lable_groupwmm from openquery(sjkxb00, ‘SELECT * FROM wmn.t_lable_groupwmn‘) select -- top 5 * identity(bigint,1,1) as Id,* into wmn.dbo.w_user_info_wmm from openquery(sjkxb00, ‘SELECT * FROM wmn.w_user_info_wmn‘) --数据导入到 bbqne 数据库中--未插入 select * from openquery(sjkxb00, ‘SELECT * FROM bbqne.t_dpt_203‘) select top 10 * from openquery(sjkxb00, ‘SELECT * FROM bbqne.t_lable_group203‘)--要把mysql中char()修改为varchar() select * from openquery(sjkxb00, ‘SELECT * FROM bbqne.w_user_info_203‘)
以上是关于mysql 导入sqlserver数据库的主要内容,如果未能解决你的问题,请参考以下文章