sqlserver教程网

当前位置: 主页 > 数据维护 >

Access数据向SQLServer迁移

时间:2014-11-26 08:34来源:www.sqlserver.net.cn 作者:admin 点击:
说明:Users是定义好的存在的表,temptable是没有定义,AccessTable是Access的表. 1、启用Ad Hoc Distributed Queries exec sp_configure show advanced options,1 reconfigure exec sp_configure Ad Hoc Distributed Queries,1 reconf
说明:Users是定义好的存在的表,temptable是没有定义,AccessTable是Access的表.
1、启用Ad Hoc Distributed Queries
   exec sp_configure 'show advanced options',1 
   reconfigure 
   exec sp_configure 'Ad Hoc Distributed Queries',1 
   reconfigure
2、导入SQL Server 2008
   SELECT * into temptable FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0', 'Data  Source="H:\\Data\\Database.mdb";User ID=Admin;Password=')...AccessTable
   insert into Users(ID1,ID2,ID3,...) select ID1,ID2,ID3,...from temptable
3、关闭Ad Hoc Distributed Queries
   exec sp_configure 'Ad Hoc Distributed Queries',0 
    reconfigure 
    exec sp_configure 'show advanced options',0 
    reconfigure
    如果存在问题,可能是以下原因:Data Source 写成了Data Source,两个连接字符串后都少写了分号。

这里是语句

下面,介绍也可以图形操作界面的







下一步,然后选择导入表。最后完成。 (责任编辑:admin)
顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
验证码: 点击我更换图片