0

I have my local database prova and another database SOFIADR. I want to insert into the table Events of the prova database the rows of data retrieved from the linked database server SOFIADR. The database SOFIADR is a linked of my local database server test.

The following query in the database NKSOFIA works:

select *
from ARA_01.ARA01.dbo.monodosi_tab

If I move into my local database prova and try to import data in my table events I write:

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

But I get an error:

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.

How can I do that?

enter image description here

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
filippo
  • 3
  • 2
  • 8

2 Answers2

1

Use this syntax:

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

According to your pic:

[ARA2].[Database Name].[dbo].[monodosi_tab]
McNets
  • 10,352
  • 3
  • 32
  • 61
0

Due to the differences between ORA and MS-SQL use [LINKED SERVER].[USER_TABLE_SPACE (username)].[TableName] or [ARA_01]..[SOFIADR].[monodosi_tab]

sinrtb
  • 136
  • 1
  • 2
  • 6