標籤:
#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 Idselect 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_groupwmmfrom 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資料庫