#MySQL import SQL Server database
EXECMaster.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'--data import into the Loreal database--cast (null as bigint) as IdSelect Identity(bigint,1,1) asId* intoLoreal.dbo.Comments from OpenQuery(Sjkxb00,'SELECT * from loreal.t_comment_5927833634809674453')--data import into the WMM databaseSelect--Top 5 * Identity(bigint,1,1) asId* intoWMN.DBO.T_LABLE_GROUPWMM from OpenQuery(Sjkxb00,'SELECT * from Wmn.t_lable_groupwmn')Select--Top 5 * Identity(bigint,1,1) asId* intoWMN.DBO.W_USER_INFO_WMM from OpenQuery(Sjkxb00,'SELECT * from Wmn.w_user_info_wmn')--data import into the Bbqne database--not insertedSelect * from OpenQuery(Sjkxb00,'SELECT * from bbqne.t_dpt_203')Select Top Ten * from OpenQuery(Sjkxb00,'SELECT * from bbqne.t_lable_group203')--to change the char () in MySQL to varchar ()Select * from OpenQuery(Sjkxb00,'SELECT * from bbqne.w_user_info_203')
MySQL Import SQL Server database