0

I have seen a lot of questions about this but I couldn't find the correct answer for me which works.

The object which triggers the problem is like

test123.de.company.com.Database.dbo.Table

Test123.de.company.com

is the database Server.

Object name contains more than the maximum prefixes allowed

I have tried to write it like this [test123.de.company.com].Database.dbo.Table just like [test123.de.company.com].[Database].[dbo].[Table]

Can you tell me what's wrong with this?

Dale K
  • 25,246
  • 15
  • 42
  • 71
Chris
  • 3
  • 1
  • I don't know what is strictly _wrong_ with what you are doing...but why are you using this naming convention for your database objects? Why not use something shorter? – Tim Biegeleisen May 25 '20 at 08:23
  • I try to join two tables from different db-servers. Isn't this the right way to get access to a table from another server if u type server.database.table? – Chris May 25 '20 at 08:26

1 Answers1

0

Please try this:

["test123.de.company.com"].[Database].[dbo].[Table] 

OP also encountered a new problem after implementing this solution above. OP said:

Thank you! This worked for me. To be more precise, the join is for a view and if I save/close and then later get back to the design option the quote marks are removed and there is [test123.de.company.com] left over and the error returns. Is there a way to keep them fixed? Otherwise if I change anything I always have to add the quote marks again and again

Then with the help of DaleK that problem also was solved. DaleK:

Don't use the design option, script it as alter instead

Dale K
  • 25,246
  • 15
  • 42
  • 71
VBoka
  • 8,995
  • 3
  • 16
  • 24
  • Thank you! This worked for me. To be more precise, the join is for a view and if I save/close and then later get back to the design option the quote marks are removed and there is [test123.de.company.com] left over and the error returns. Is there a way to keep them fixed? Otherwise if I change anything I always have to add the quote marks again and again – Chris May 25 '20 at 08:36
  • 1
    Hi @Chris did this comment from DaleK helped ? Also please, if this is the correct answer to your question please accept it. If you do not know how please ask. Cheers! – VBoka May 25 '20 at 08:56
  • Yes alter helped instead of using the design option, thank you! – Chris May 26 '20 at 06:03
  • Happy to hear that. Thanks for marking my answer. @DaleK thanks for assistance on the comment. Cheers! – VBoka May 26 '20 at 06:36