Home > Database > Mysql Tutorial > body text

Access数据结构转到SQLServer中去

WBOY
Release: 2016-06-07 15:19:12
Original
1093 people have browsed it

select * into Cargo from OpenDataSource('Microsoft.Jet.OLEDB.4.0','Data Source=C:/Program Files/SinoThirdPL/ThirdPL.mdb;Jet OLEDB:Database Password=sinochainwms;user id=admin;password=')...Cargo SQL SERVER 2005和SQL SERVER 2008执行这个命令

select * into Cargo from OpenDataSource('Microsoft.Jet.OLEDB.4.0','Data Source=C:/Program Files/SinoThirdPL/ThirdPL.mdb;Jet OLEDB:Database Password=sinochainwms;user id=admin;password=')...Cargo 

SQL SERVER 2005和SQL SERVER 2008执行这个命令时出现错误:

SQL Server 阻止了对组件 'Ad Hoc Distributed Queries' 的 STATEMENT'OpenRowset/OpenDatasource' 的访问,因为此组件已作为此服务器安全配置的一部分而被关闭。系统管理员可以通过使用 sp_configure 启用 'Ad Hoc Distributed Queries'。有关启用 'Ad Hoc Distributed Queries' 的详细信息,请参阅 SQL Server 联机丛书中的 "外围应用配置器"。

启用Ad Hoc Distributed Queries的方法,执行下面的查询语句就可以了:

使用完毕后,记得一定要要关闭它,因为这是一个安全隐患,切记执行下面的SQL语句

第二种方式:

通过SQLSERVER DTS工具

 

 

--Excel数据结构转到SQLServer

insert into Filter_SGM_Dealer
SELECT NEWID(),* FROM  OPENROWSET( 'Microsoft.Jet.OLEDB.4.0 ','Excel 5.0;DatabASE=D:/v3.xls;HDR=YES;IMEX=1 ', [汇总$])

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template