﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2008 / SQL Server Newbies  / SELECT from OPENDATASOURCE error / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Sun, 19 May 2013 12:36:53 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: SELECT from OPENDATASOURCE error</title><link>http://www.sqlservercentral.com/Forums/Topic1420587-1292-1.aspx</link><description>Define "does not work." Error message? Empty resultset? Remember, I cannot see what you see :-)</description><pubDate>Tue, 19 Feb 2013 07:19:40 GMT</pubDate><dc:creator>opc.three</dc:creator></item><item><title>RE: SELECT from OPENDATASOURCE error</title><link>http://www.sqlservercentral.com/Forums/Topic1420587-1292-1.aspx</link><description>The query works when I pass it user id and password, but it does not work when I use integrated security. Any idea how to get integrated security to work?</description><pubDate>Tue, 19 Feb 2013 06:52:35 GMT</pubDate><dc:creator>lsalih</dc:creator></item><item><title>RE: SELECT from OPENDATASOURCE error</title><link>http://www.sqlservercentral.com/Forums/Topic1420587-1292-1.aspx</link><description>The information you have provided does not compute. Are you sure your login has access to that table?What does this return?[code="sql"]SELECT  *FROM    OPENDATASOURCE('SQLNCLI', 'Data Source=DESTSERVR\INSTANCE;Integrated Security=SSPI').TESTTBL.sys.tablesWHERE   name = 'TBLNAME';[/code]What about when using a username and password?[code="sql"]SELECT  *FROM    OPENDATASOURCE('SQLNCLI', 'Data Source=DESTSERVR\INSTANCE;user id=test;password=psw').TESTTBL.sys.tablesWHERE   name = 'TBLNAME';[/code]</description><pubDate>Fri, 15 Feb 2013 12:55:37 GMT</pubDate><dc:creator>opc.three</dc:creator></item><item><title>RE: SELECT from OPENDATASOURCE error</title><link>http://www.sqlservercentral.com/Forums/Topic1420587-1292-1.aspx</link><description>I said I GOT CONFUSED :) No one said anything :)</description><pubDate>Fri, 15 Feb 2013 12:05:45 GMT</pubDate><dc:creator>lsalih</dc:creator></item><item><title>RE: SELECT from OPENDATASOURCE error</title><link>http://www.sqlservercentral.com/Forums/Topic1420587-1292-1.aspx</link><description>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</description><pubDate>Fri, 15 Feb 2013 12:04:53 GMT</pubDate><dc:creator>lsalih</dc:creator></item><item><title>RE: SELECT from OPENDATASOURCE error</title><link>http://www.sqlservercentral.com/Forums/Topic1420587-1292-1.aspx</link><description>Who said anything about OPENQUERY? You do not need OPENDATASOURCE to work with a Linked Server.</description><pubDate>Fri, 15 Feb 2013 12:02:35 GMT</pubDate><dc:creator>opc.three</dc:creator></item><item><title>RE: SELECT from OPENDATASOURCE error</title><link>http://www.sqlservercentral.com/Forums/Topic1420587-1292-1.aspx</link><description>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. </description><pubDate>Fri, 15 Feb 2013 11:50:28 GMT</pubDate><dc:creator>lsalih</dc:creator></item><item><title>RE: SELECT from OPENDATASOURCE error</title><link>http://www.sqlservercentral.com/Forums/Topic1420587-1292-1.aspx</link><description>[quote][b]lsalih (2/15/2013)[/b][hr]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[/quote]Linked Servers are not in play when using OPENDATASOURCE. If you have a working Linked Server then maybe try this instead:[code="sql"]select * from [DESTSERVR\INSTANCE].[TESTTBL].dbo.[TBLNAME] [/code]</description><pubDate>Fri, 15 Feb 2013 11:45:38 GMT</pubDate><dc:creator>opc.three</dc:creator></item><item><title>RE: SELECT from OPENDATASOURCE error</title><link>http://www.sqlservercentral.com/Forums/Topic1420587-1292-1.aspx</link><description>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</description><pubDate>Fri, 15 Feb 2013 11:13:32 GMT</pubDate><dc:creator>lsalih</dc:creator></item><item><title>RE: SELECT from OPENDATASOURCE error</title><link>http://www.sqlservercentral.com/Forums/Topic1420587-1292-1.aspx</link><description>[quote][b]opc.three (2/15/2013)[/b][hr]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.[/quote]</description><pubDate>Fri, 15 Feb 2013 09:49:32 GMT</pubDate><dc:creator>opc.three</dc:creator></item><item><title>RE: SELECT from OPENDATASOURCE error</title><link>http://www.sqlservercentral.com/Forums/Topic1420587-1292-1.aspx</link><description>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...</description><pubDate>Fri, 15 Feb 2013 09:27:37 GMT</pubDate><dc:creator>lsalih</dc:creator></item><item><title>RE: SELECT from OPENDATASOURCE error</title><link>http://www.sqlservercentral.com/Forums/Topic1420587-1292-1.aspx</link><description>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.</description><pubDate>Fri, 15 Feb 2013 09:17:26 GMT</pubDate><dc:creator>opc.three</dc:creator></item><item><title>SELECT from OPENDATASOURCE error</title><link>http://www.sqlservercentral.com/Forums/Topic1420587-1292-1.aspx</link><description>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 1The 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</description><pubDate>Fri, 15 Feb 2013 08:35:15 GMT</pubDate><dc:creator>lsalih</dc:creator></item></channel></rss>