OPENROWSET mysteriously stopped working

  • This worked last week:

    select top 1 a.* from

    OPENROWSET('SQLOLEDB','myServer';'myLogin';'myPassword',

    'SELECT * FROM myDB..myTable') AS a

    Now I get errors:

    OLE DB provider "SQLNCLI10" for linked server "(null)" returned message "Login timeout expired".

    OLE DB provider "SQLNCLI10" for linked server "(null)" returned message "A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.".

    Msg 53, Level 16, State 1, Line 0

    Named Pipes Provider: Could not open a connection to SQL Server [53].

    Now it doesn't. Any ideas where to start troubleshooting?

    TIA

    [font="Courier New"]ZenDada[/font]

  • ZenDada (7/16/2010)


    This worked last week:

    select top 1 a.* from

    OPENROWSET('SQLOLEDB','myServer';'myLogin';'myPassword',

    'SELECT * FROM myDB..myTable') AS a

    Now I get errors:

    OLE DB provider "SQLNCLI10" for linked server "(null)" returned message "Login timeout expired".

    OLE DB provider "SQLNCLI10" for linked server "(null)" returned message "A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.".

    Msg 53, Level 16, State 1, Line 0

    Named Pipes Provider: Could not open a connection to SQL Server [53].

    Now it doesn't. Any ideas where to start troubleshooting?

    TIA

    Yep... make sure they didn't change the domain name or the server name of the target server and make sure they didn't change the login name or password.

    As a side bar, having the login name and password in code is a really bad idea. You really need to figure out a way to use a trusted connection.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.
    "Change is inevitable... change for the better is not".

    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)
    Intro to Tally Tables and Functions

  • Jeff Moden (7/16/2010)


    Yep... make sure they didn't change the domain name or the server name of the target server and make sure they didn't change the login name or password.

    As a side bar, having the login name and password in code is a really bad idea. You really need to figure out a way to use a trusted connection.

    Thanks for your reply Jeff! This is just me needing to run ad hoc queries to QA some SSIS work I did, I don't use this in code. I am checking data that spans two servers. There is no "they" - I am the DBA. But I do have a network guy who does all the IT stuff. So I approached him about it. He didn't have a clue. I tried changing the syntax to use trusted connection and that didn't work either even though I am sysadmin. Also, I didn't really use a domain or server name, I used the IP address. And the IP address works just fine when I use it to connect through the connection explorer in SSMS with both windows and ss auth.

    [font="Courier New"]ZenDada[/font]

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

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