Re: How to specify an instance name in a SQL statement



It doesn't work that way. You reference the Linked server name not the SQL
Server instance in the query. You must set up the linked server first. See
sp_addlinkedserver in BooksOnLine for more details.

--
Andrew J. Kelly SQL MVP

"DMurray" <DMurray@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:DC3F4EF4-5A17-404B-ADD9-4FF2491C3F4E@xxxxxxxxxxxxxxxx
Hello,
I am trying to get info from a linked server, but the instance is not the
default instance. I have tried:
select *from myserver\myinstance.mydb.dbo.mytable

but get a syntax error due to the backslash.

How should I specify the instance I wish to use?

Thanks in advance
Dave


.



Relevant Pages

  • ANSI defaults, Linked Server
    ... Access database that our Credit Card processing software uses. ... written a SP to grab some data from this Linked Server, and from my local SQL ... Enable these options and the reissue your query" ...
    (microsoft.public.sqlserver.programming)
  • RE: 0x80004005 - you need permission to view its data
    ... When creating the Access linked server, make sure the data source using UNC ... the SQL server(Both SQL authentication and Windows Authentication work). ... 262177 How to enable Kerberos event logging ...
    (microsoft.public.sqlserver.security)
  • Linked Servers - Real Post
    ... I am running SQL 2k on Win 2k. ... a front end for our SQL database. ... added the linked server I want, and SQL queries it fine, ... leaving the "local server login to remote server login" ...
    (microsoft.public.sqlserver.programming)
  • Linked Server - Issue
    ... I have to access a Linked Server S2 (SQL 2000). ... In S1 I have setup a linked server using sp_addlinkedserver pointing to S2. ... Both MyAccount and SpecialAccount has access permissions to S2. ... Reason Not associated with a Trusted SQL ...
    (microsoft.public.sqlserver.programming)
  • OPENQUERY results....
    ... I have a linked server from a SQL 2000 server to an IBM AS/400. ... The second query runs much slower, I assume this is because it's selecting ... criteria surely the first statement should also return them? ...
    (microsoft.public.sqlserver.programming)