2017-02-15 117 views
0

我有我的本地数据库prova和另一个数据库SOFIADR。我想在prova数据库的表Events中插入从链接的数据库服务器SOFIADR检索到的数据行。数据库SOFIADR是我的本地数据库服务器test的链接。SQL Server如何从链接服务器插入表

数据库以下查询NKSOFIA作品:

select * 
from ARA_01.ARA01.dbo.monodosi_tab 

如果我进入我的本地数据库prova,并试图在我的表events导入数据写到:

insert into Events (.......) 
    select field1, field2 ..... 
    from [SOFIADR].[NKSOFIA].ARA_01.ARA01.dbo.monodosi_tab 

,但我得到一个错误:

Msg 117, Level 15, State 1, Line 3
The object name 'SOFIADR.NKSOFIA.ARA_01.ARA01.dbo.monodosi_tab' includes an excessive number of prefixes. Maximum capacity is 3.

我该怎么做?

enter image description here

+0

请参阅http://stackoverflow.com/questions/4744878/error-when-insert-into-linked-server – user1327961

回答

0

使用此语法:

[LINKED SERVER].[DATABASE].[Schema].[TableName] 

根据您的图片:

[ARA2].[Database Name].[dbo].[monodosi_tab] 
0

我尝试这样的:

insert into Buste(...) 
    select field1... 
    from [ARA_04].[SOFIADR].[dbo].[monodosi_tab] 

,但它不工作,这是错误:。

Msg 7314, Level 16, State 1, Line 1
The OLE DB provider "SQLNCLI10" for linked server "ARA_04" does not include the table "" SOFIADR. "Dbo". "" Monodosi_tab "". The table does not exist or the current user does not have the required permissions.

0

由于之间ORA和MS-SQL使用 [LINKED SERVER]的差[USER_TABLE_SPACE(用户名)] [表名] 或 [ARA_01] .. [SOFIADR] 。[monodosi_tab]

相关问题