SQL Server: is it possible to get data from another SQL server without setting linked server?

11,120

You could use OPENROWSET, which'll require the connection info, username & password...

While I understand that the client believes that having an always-on connection to their data is risky, that's why you lock down the account. OPENROWSET means including the connection info in plain text.

Share:
11,120
andr111
Author by

andr111

Updated on June 15, 2022

Comments

  • andr111
    andr111 almost 2 years

    I need to do the following query (for example):

    SELECT c1.CustomerName FROM Customer as c1
    INNER JOIN [ExternalServer].[Database].[dbo].[Customer] as c2
    ON c2.RefId = c1.RefId
    

    For some security reason my client doesn't allow me to create a linked server. The user under whom I execute this query has access to both tables. Is it possible to make it work without using linked server? Thanks.

  • Lasse V. Karlsen
    Lasse V. Karlsen almost 14 years
    Which is basically just a temporary linked server.
  • OMG Ponies
    OMG Ponies almost 14 years
    @Lasse V. Karlsen: By that logic, any connection string and username/password is a linked server. I'd prefer that Linked Servers be used, but the OP is clear about the client not allowing it.
  • andr111
    andr111 almost 14 years
    thanks a lot for suggestion. I will try it. Although, it needs additional configuration that, of course, needs additional permissions which I'm not sure my client can give me.