selecting a table though a linked server

  • Hi,

    I added a linked server in SQL Enterprise Manager. The server I linked to resides on a different domain, so its name in the list of Linked Servers on my machine looks like:

    EEmpact.Bunnhill.com

    I can see a list of tables/views on the linked server in my Enterprise Manager

    When I try to access a table on the linked serer from my machine as

    select top 10 * from EEmpact.Bunnhill.com.dbo.AIM024

    I’m getting an error:

    Server: Msg 117, Level 15, State 1, Line 1

    The object name 'EEmpact.Bunnhill.com.dbo.' contains more than the maximum number of prefixes. The maximum is 3

    Is there a workaround for that? Maybe some kind of alias for the linked server in order to reduce the number of prefixes?

    Thanks for your time,

    Sergei

  • the poper use would be servername.databasename.schemaname.table

    since your server name has a dot in it, it needs to be contained in square brackets

    so I think yours would be [EEmpact.Bunnhill.com].[databasename].[dbo].[AIM024]

  • Thanks a lot, Adam, square brackets work.

    Sergei

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply