服务热线
198-9911-5815
虚拟主机域名注册-常见问题 → 数据库问题 → 数据库问题 | ||||
实现步骤: 1.从MySQL网站下载最新的MySQL ODBC驱动:http://www.mysql.com/downloads/connector/odbc/,目前的版本是5.1.8 2.在SQL Server所在的服务器安装 3.在SQL Server建立Linkserver,可通过如下脚本实现: USE [master] GO EXEC master.dbo.sp_addlinkedserver @server = N'ServerName', @srvproduct = N'ServerName', @provider = N'MSDASQL', @provstr = N'Driver={MySQL ODBC 5.1 Driver};Server=ServerName;Database=DBName;User=Username;Password=pwd;Option=3;', @catalog = N'DBName' 之后可以通过OPENQUERY的方式调用MySQL的数据: INSERT INTO OPENQUERY(Servername,'select * from DBName.tablename') SELECT '1' SELECT * FROM OPENQUERY(Servername,'select * from DBName.tablename') UPDATE OPENQUERY(Servername,'select * from DBName.tablename') SET colname= '2' WHERE colname= '1' SELECT * FROM OPENQUERY(Servername,'select * from DBName.tablename')
|
||||
>> 相关文章 | ||||
没有相关文章。 |