SQL Server Performance

Linked Server

Discussion in 'SQL Server 2008 General DBA Questions' started by RVG, Sep 9, 2010.

  1. RVG Member

    I have two instances on my local machine and I have created a linked server between two instances.
    Name of Default Instance: Ravi-PC
    Name of my Named Instance: Ravi-PCkatmai
    On the default instance I created a linked server called, Ravi-PCKatmai
    Server Options: RPC, RPC out set to true.
    Security Options: Be made using the logins current Security content
    Local Server Login: Sa Account of my default instance its password
    When I Tried to execute the query against the databases I get the following error.
    Msg 102, Level 15, State 1, Line 1
    Incorrect syntax near '-'.
    Can anyone let me know how to solve this error, please.
  2. ashish287 New Member

    change this
  3. RVG Member

    Thanks Asish, Its working, only if I'm using like this: [ravi-pckatmai].
  4. ashish287 New Member

    good to hear. yes forget to mention the instance name as well within the brackets.
    the problem was because sql server not able to understand '-' as a character in name so for such names either dbname or servername or object name, it need to provided within [ ]. The best example is sharepoint databases name.
  5. RVG Member

    Thanks for your reply , Asish[:)]

Share This Page