MySQL中如何实现SQL Server中OPENROWSET方法?

bill024 2011-06-21 03:08:16
想要远程连接一个Mysql数据库,访问其中的表,Mysql中有没有SQL Server类似的语法:
INSERT 本地表 SELECT * FROM OPENDATASOURCE('SQLOLEDB', 'Data Source=192.168.1.123;User ID=sa;Password=test').pubs.dbo.authors
...全文
444 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
wwwwb 2011-06-21
  • 打赏
  • 举报
回复
没有,安装FEDERATED引擎

在host: 168.56.41.11建个FEDERATED 表

CREATE TABLE xxx_b (
id INT(20) NOT NULL AUTO_INCREMENT,
username VARCHAR(32) NOT NULL DEFAULT '',
password VARCHAR(32),
PRIMARY KEY (id)
)
ENGINE=FEDERATED
CONNECTION='mysql://broot:bpassword@268.56.71.11:3306/dbname/b表';

再查询即可,如果在本地已经安装MYSQL驱动,并可访问远程MYSQL,用JETSQL也可以导入
小小小小周 2011-06-21
  • 打赏
  • 举报
回复
用federated 存储引擎可以实现。
SQL Server 2012 Data Integration Recipes provides focused and practical solutions to real world problems of data integration. Need to import data into SQL Server from an outside source? Need to export data and send it to another system? SQL Server 2012 Data Integration Recipes has your back. You'll find solutions for importing from Microsoft Office data stores such as Excel and Access, from text files such as CSV files, from XML, from other database brands such as Oracle and MySQL, and even from other SQL Server databases. You'll learn techniques for managing metadata, transforming data to meet the needs of the target system, handling exceptions and errors, and much more. What DBA or developer isn't faced with the need to move data back and forth? Author Adam Aspin brings 10 years of extensive ETL experience involving SQL Server, and especially satellite products such as Data Transformation Services and SQL Server Integration Services. Extensive coverage is given to Integration Services, Microsoft's flagship tool for data integration in SQL Server environments. Coverage is also given to the broader range of tools such as OPENDATASOURCE, linked servers, OPENROWSET, Migration Assistant for Access, BCP Import, and BULK INSERT just to name a few. If you're looking for a resource to cover data integration and ETL across the gamut of Microsoft's SQL Server toolset, SQL Server 2012 Data Integration Recipes is the one book that will meet your needs. * Provides practical and proven solutions towards creating resilient ETL environments * Clearly answers the tough questions which professionals ask * Goes beyond the tools to a thorough discussion of the underlying techniques * Covers the gamut of data integration, beyond just SSIS * Includes example databases and files to allow readers to test the recipes

57,063

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧