0

I want to copy my table into AMAPHLINK server, but it keeps giving me an error.

select *
into AMAPHLINK.Payroll.dbo.[EmpResignTb]
from Payroll.dbo.EmpResignTb

Error:

The object name 'AMAPHLINK.Payroll.dbo.EmpResignTb' contains more than the maximum number of prefixes. The maximum is 2

Dale K
  • 25,246
  • 15
  • 42
  • 71
codeSeven
  • 479
  • 5
  • 23

2 Answers2

1

You are getting an error because you are not using a valid name.

The valid syntax is server_name.database_name.schema_name.object_name as referenced on the MSDN article for INSERT.

Remove the incorrect schema and try again.

Solution:

Use square brackets "[]" around the name and remote database server

select *
into [AMAPHLINK].[Payroll].[dbo].[EmpResignTb]
from [Payroll].[dbo].[EmpResignTb]
Dale K
  • 25,246
  • 15
  • 42
  • 71
THE LIFE-TIME LEARNER
  • 1,476
  • 1
  • 8
  • 18
0

It appears this can't be done over linked servers.

You could create the table first then do an INSERT INTO.

The same question was asked here: error when insert into linked server

Dale K
  • 25,246
  • 15
  • 42
  • 71
Watermelon
  • 169
  • 4