|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Today @ 6:35 AM
Points: 44,
Visits: 188
|
|
I am trying to select from a table that is stored on a different server, I am using opendatasource. When I run the query, I get:
Msg 7314, Level 16, State 1, Line 1 The OLE DB provider "SQLNCLI10" for linked server "(null)" does not contain the table ""TESTTBL"."dbo"."TBLNAME"". The table either does not exist or the current user does not have permissions on that table.
The select statement is as following:
select * from OPENDATASOURCE('SQLNCLI', 'Data Source=DESTSERVR\INSTANCE;Integrated Security=SSPI').[TESTTBL].dbo.[TBLNAME]
Both database and table do exist on the destination server, I tested the same query from another server and it works. I did query all environments sysservers, and they are all setup identical, please advice.
Lava
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 11:33 AM
Points: 6,713,
Visits: 11,748
|
|
Check that the Windows account you're using to log into the SQL Server with has a login and permissions to select from that table on the remote server. If it does then make sure the server's can reach each other, i.e. that network connectivity is possible.
__________________________________________________________________________________________________ There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Believe you can and you're halfway there. --Theodore Roosevelt
Everything Should Be Made as Simple as Possible, But Not Simpler --Albert Einstein
The significant problems we face cannot be solved at the same level of thinking we were at when we created them. --Albert Einstein
1 apple is not exactly 1/8 of 8 apples. Because there are no absolutely identical apples. --Giordy
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Today @ 6:35 AM
Points: 44,
Visits: 188
|
|
Forgot to mention that when I run the queries on different instances same box, it works... However, it does not work when I do distributed query, from one box to another...
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 11:33 AM
Points: 6,713,
Visits: 11,748
|
|
opc.three (2/15/2013) Check that the Windows account you're using to log into the SQL Server with has a login and permissions to select from that table on the remote server. If it does then make sure the server's can reach each other, i.e. that network connectivity is possible.
__________________________________________________________________________________________________ There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Believe you can and you're halfway there. --Theodore Roosevelt
Everything Should Be Made as Simple as Possible, But Not Simpler --Albert Einstein
The significant problems we face cannot be solved at the same level of thinking we were at when we created them. --Albert Einstein
1 apple is not exactly 1/8 of 8 apples. Because there are no absolutely identical apples. --Giordy
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Today @ 6:35 AM
Points: 44,
Visits: 188
|
|
When I go to linked server, I can see the system catalogs. Below is how I created the the linked server:
EXEC sp_addlinkedserver @server=N'Webdev', @srvproduct=N'', @provider=N'SQLNCLI', @datasrc=N'DESTSERVR\INSTANCE';
The security is set to "Ba made using the login's current security context.
My account is set as admin to the server on both nodes.
Lava
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 11:33 AM
Points: 6,713,
Visits: 11,748
|
|
lsalih (2/15/2013) When I go to linked server, I can see the system catalogs. Below is how I created the the linked server:
EXEC sp_addlinkedserver @server=N'Webdev', @srvproduct=N'', @provider=N'SQLNCLI', @datasrc=N'DESTSERVR\INSTANCE';
The security is set to "Ba made using the login's current security context.
My account is set as admin to the server on both nodes.
Lava Linked Servers are not in play when using OPENDATASOURCE. If you have a working Linked Server then maybe try this instead:
select * from [DESTSERVR\INSTANCE].[TESTTBL].dbo.[TBLNAME]
__________________________________________________________________________________________________ There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Believe you can and you're halfway there. --Theodore Roosevelt
Everything Should Be Made as Simple as Possible, But Not Simpler --Albert Einstein
The significant problems we face cannot be solved at the same level of thinking we were at when we created them. --Albert Einstein
1 apple is not exactly 1/8 of 8 apples. Because there are no absolutely identical apples. --Giordy
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Today @ 6:35 AM
Points: 44,
Visits: 188
|
|
My mistake, I am not using openquery but opendatasource... I got confused as I was trying to see what the issue is... Anyhow, in any cases, security might not be an issue as I have admin access to all boxes.
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 11:33 AM
Points: 6,713,
Visits: 11,748
|
|
Who said anything about OPENQUERY? You do not need OPENDATASOURCE to work with a Linked Server.
__________________________________________________________________________________________________ There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Believe you can and you're halfway there. --Theodore Roosevelt
Everything Should Be Made as Simple as Possible, But Not Simpler --Albert Einstein
The significant problems we face cannot be solved at the same level of thinking we were at when we created them. --Albert Einstein
1 apple is not exactly 1/8 of 8 apples. Because there are no absolutely identical apples. --Giordy
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Today @ 6:35 AM
Points: 44,
Visits: 188
|
|
You are correct, it is security... I issued same statement this time using user id and password to see if it works, and yes it did give me results:
select * from OPENDATASOURCE('SQLNCLI', 'Data Source=DESTSERVR\INSTANCE;user id =test;password=psw' ).[TESTTBL].dbo.[TBLNAME]
The question I have is that if I am running the query, and my windows account is admin on both boxes, why isn't it working then!?
Thank you.
Lava
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Today @ 6:35 AM
Points: 44,
Visits: 188
|
|
I said I GOT CONFUSED :) No one said anything :)
|
|
|
|