Showing posts with label machine. Show all posts
Showing posts with label machine. Show all posts

Wednesday, March 28, 2012

Linked Server problem when querying

I have a linked SQL Server on another machine which is created using a stored procedure that executes the following:

EXEC sp_addlinkedserver @.server = 'Achilles\Mixed', @.srvproduct = ' ', @.provider = 'SQLNCLI', @.datasrc = 'Archilles\Mixed', @.catalog = 'DB_INTRANET'

The stored procedure executes successfully and I can also succesfully DROP the linked server. However when I try to query tables in linked databases using:

SELECT * FROM DB_INTRANET...Employees

I get the following error:

OLE DB provider "SQLNCLI" for linked server "DB_Intranet" returned message "Communication link failure".

Msg 10054, Level 16, State 1, Line 0 TCP Provider: An existing connection was forcibly closed by the remote host.

Msg 18452, Level 14, State 1, Line 0 Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.

The logins are Windows Authentication and even if I use sp_addlinkedsrvlogin to map logins it still gives me the same error.

I have no problems linking and querying linked Access Databases but can't do it for the SQL Server DBs.

Does anyone have any suggestions please.

Hi,

the mapping of the logins did not work. What command did you use to use the WIndows login on the other server ?

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

|||

Please check two things:
1. make sure SQL 2005 allow remote access
2. make sure you set right userid/password for linked server.

Thanks

|||

Hi,

I have the same problem. But the distributed query seems to work on the management studio of the server but bot accross the network on other management studio with the same impersonated logins.

|||

I had to create a SQL authenticated login on the remote server (loginname) and then all local logins are mapped to the one remote SQL login using the Security page of the Linked Servers Properties dialogue.

I could not get it to pass Windows authenticated logins to the remote server at all.

In the Security Page of Linked Servers Properties dialogue.

For a Login not defined in the above list Connections will:

Be made using this security context:

Remote Login: Loginname

With Password: LoginPassword

Linked server problem "Login timeout expired"

Hello All,

My application is dependent on two databases one is on sql 2005 machine and other is on sql 2000 machine. A linked server is establish between these two using sql account which has appropriate rights on both server's databases.

application works fine but after some time it crashes and if i see error from sql profiler i get the error

OLE DB provider "SQLNCLI" for linked server "sql2000machine" returned message "Login timeout expired".

Few days back applciation was working absolutly fine, but i was trying to make linked sever through windows account, i dnt know wat has i changed during achiveing that setup that now application (linked server) is not working even with sql account.

please help its urgent.

I am moving this thread to the Data Access forum. Hopefully someone from that forum will be able to help.

Thanks,

-Raul Garcia

SDE/T

SQL Server Engine

|||What do you get if you do the following?
select * from sys.servers

Linked Server Problem

We migrated our production SQL Server 2000 database to a new machine and all seems to be working well except for our linked server on our SQL Server 2005 instance that points to our SQL Server 2000 database that was just moved. We get the following error when we try to query a table on the 2000 database. I have read this article in the Books online but that does not seem to apply to us ( http://msdn2.microsoft.com/en-us/library/ms175496.aspx ).

OLE DB provider "SQLNCLI" for linked server "SQLPRD-DBS" returned message "Communication link failure".

Msg 233, Level 16, State 1, Line 0

Named Pipes Provider: No process is on the other end of the pipe.

Msg 18456, Level 14, State 1, Line 0

Login failed for user 'sa1'.

Anyone have any ideas?

Thanks!!!

could be a permission problem with the linked server login

make use of the useslelf option of the addsqlserver login

to properly map users to the linked server

sp_addlinkedsrvlogin [ @.rmtsrvname = ] 'rmtsrvname'

[ , [ @.useself = ] 'useself' ]

[ , [ @.locallogin = ] 'locallogin' ]

[ , [ @.rmtuser = ] 'rmtuser' ]

[ , [ @.rmtpassword = ] 'rmtpassword' ]

Arguments

[ @.rmtsrvname = ] 'rmtsrvname'

Is the name of a linked server that the login mapping applies to. rmtsrvname is sysname, with no default.

[ @.useself = ] 'useself'

Determines the name of the login used to connect to the remote server. useself is varchar(8), with a default of TRUE.

A value of true specifies that logins use their own credentials to connect to rmtsrvname, with the rmtuser and rmtpassword arguments being ignored. false specifies that the rmtuser and rmtpassword arguments are used to connect to rmtsrvname for the specified locallogin. If rmtuser and rmtpassword are also set to NULL, no login or password is used to connect to the linked server.

[ @.locallogin = ] 'locallogin'

Is a login on the local server. locallogin is sysname, with a default of NULL. NULL specifies that this entry applies to all local logins that connect to rmtsrvname. If not NULL, locallogin can be a SQL Server login or a Windows login. The Windows login must have been granted access to SQL Server either directly, or through its membership in a Windows group granted access.

[ @.rmtuser = ] 'rmtuser'

Is the user name used to connect to rmtsrvname when useself is false. rmtuser is sysname, with a default of NULL.

[ @.rmtpassword = ] 'rmtpassword'

Is the password associated with rmtuser. rmtpassword is sysname, with a default of NULL.

examples

A. Connecting all local logins to the linked server by using their own user credentials

The following example creates a mapping to make sure that all logins to the local server connect through to the linked server Accounts by using their own user credentials.

EXEC sp_addlinkedsrvlogin 'Accounts'

B. Connects a specific login to the linked server by using different user credentials

The following example creates a mapping to make sure that the Windows user Domain\Mary connects through to the linked server Accounts

by using the login MaryP and password d89q3w4u.

EXEC sp_addlinkedsrvlogin 'Accounts', 'false', 'Domain\Mary', 'MaryP', 'd89q3w4u'

Monday, March 26, 2012

Linked Server on SQL2000 to DB2 - desperate...

Hi All,
I am close before throwing the machine out of the window.
I tried to establish a linked server on our SQL2000 server pointing to a DB.

EXEC sp_addlinkedserver
@.server = 'DB2',
@.srvproduct = 'IBM OLE DB Provider for DB2 Servers',
@.provider = 'IBMDADB2',
@.provstr='DSN=JDE_PROD;UID=XXXX;PWD=XXX;DATABASE=J DE_PROD;'

EXEC sp_addlinkedsrvlogin 'DB2', false, NULL, 'XXX', 'XXXX'

If I query the LS using query analyzer or the Enterprise Manager both start
to hang, never responding again.
To be honest I am quite new to this topic but I read a lot and also tried a
lot ;)

Some articles talk about SNA Servers to be installed first, others about
some client tools.
I am confused by now...

Could anybody please be so kind and tell me how to connect the DB2 as a
linked server?
Is my statement wrong, and if so how should it look like? Why does the
application start to hang? Do I really need to install additional software
to do so?

Our DB2 expert also taked about software necessary to access the DB2
mainframe. Any ideas?

Thanks a lot in advance and belive me, any hints are highly appreciated ;)

Seize the Day

Andy

Andreas Bretl
andreas.bretl@.brainlab.com"Bretl Andy" <andreas.bretl@.brainlab.com> wrote in message
news:2rfnulF19390eU1@.uni-berlin.de...
> Hi All,
> I am close before throwing the machine out of the window.
> I tried to establish a linked server on our SQL2000 server pointing to a
> DB.
> EXEC sp_addlinkedserver
> @.server = 'DB2',
> @.srvproduct = 'IBM OLE DB Provider for DB2 Servers',
> @.provider = 'IBMDADB2',
> @.provstr='DSN=JDE_PROD;UID=XXXX;PWD=XXX;DATABASE=J DE_PROD;'
> EXEC sp_addlinkedsrvlogin 'DB2', false, NULL, 'XXX', 'XXXX'
> If I query the LS using query analyzer or the Enterprise Manager both
> start
> to hang, never responding again.
> To be honest I am quite new to this topic but I read a lot and also tried
> a
> lot ;)
> Some articles talk about SNA Servers to be installed first, others about
> some client tools.
> I am confused by now...
> Could anybody please be so kind and tell me how to connect the DB2 as a
> linked server?
> Is my statement wrong, and if so how should it look like? Why does the
> application start to hang? Do I really need to install additional software
> to do so?
> Our DB2 expert also taked about software necessary to access the DB2
> mainframe. Any ideas?
>
> Thanks a lot in advance and belive me, any hints are highly appreciated ;)
> Seize the Day
> Andy
> Andreas Bretl
> andreas.bretl@.brainlab.com

This explanation might clarify the question of installing SNA/HIS client
components vs the IBM client drivers:

http://groups.google.com/groups?hl=...%40cpmsftngxa07

Have you checked that you can successfully connect from the SQL Server
server to DB2 using some kind of DB2 client tool, or even just a script? If
that's OK, then at least you know the provider is installed and working, so
the issue is likely to be the linked server definition.

You might want to check the @.provstr parameter - the syntax is specific for
each OLE DB provider, so you should make sure that it's really a valid
string for the IBM provider. There's a sample here:

http://www.connectionstrings.com

Simon|||First of all, Thanks a lot Simon for the hint,
unfortunately I still can not connect to the db2. But now I have another
errormessage never seen before:
"The provider reported an unexpected catastrophic failure."
This seems to happen during inizialisation??
I used the following registration:
EXEC sp_addlinkedserver
@.server = 'DB2',
@.srvproduct = 'Microsoft OLE DB Provider for DB2',
@.catalog = 'JDE_PROD',
@.provider = 'IBMDADB2',
@.provstr='Provider=IBMDADB2;Database=JDE_PROD;HOST NAME=xxxx;PROTOCOL=TCPIP;P
ORT=5000;uid=xxxx;pwd=xxxx;'

If I read the article correctly it should work using the DSN pointing to the
db2 which is installed on the SQL server.
But as mentioned, the error above occures or it seems that the
EnterpriseManager hangs when accessing tabes in the linked-server.

Thanks a lot Simon,

Seize the Day

Andy

Andreas Bretl
andreas.bretl@.brainlab.com|||Bretl,

If you want to use the IBM provider then you need to have IBM's DB2 Connect
product installed on the SQL Server.

If you want to use the MS provider, then you need to have Host Integration
Server 2004 (latest version on SNA Server) installed on the SQL Server as a
"nodeless" install - this is basically a server install without choosing to
install the SNA Server service.

Do you have either of these pre-requisites installed and tested first?

(If you go the MS route it's worth posting future Q's in the Host Integration
Server newsgroup on the MS public servers - you're likely to get better help
there)

Neil Pike MVP/MCSE. Protech Computing Ltd
Reply here - no email
SQL FAQ (484 entries) see
http://forumsb.compuserve.com/gvfor...p?SRV=MSDevApps
(faqxxx.zip in lib 7)
or http://www.ntfaq.com/Articles/Index...epartmentID=800
or www.sqlserverfaq.com
or www.mssqlserver.com/faq|||First of all thanks to all who tried heling me with this problem.
Actually it seemes to be a problem with the current fix-pack installation on
the JDE Database-Driver (DB2-ODBC).
Maybe it was damaged or really out of date so it could not communicate with
our SQL Server 2000.
After installing the current fixpack I was able to implement linked-server
over ODBC without problem.

What a hassle when they do not keep their system installation up to date.

Thanks again and have a geat week,

Andy Bretl
andreas.bretl@.brainlab.com

Friday, March 23, 2012

linked server Login timeout expired error

Hello All,

My application is dependent on two databases one is on sql 2005 machine and other is on sql 2000 machine. A linked server is establish between these two using sql account which has appropriate rights on both server's databases.

application works fine but after some time it crashes and if i see error from sql profiler i get the error

OLE DB provider "SQLNCLI" for linked server "sql2000machine" returned message "Login timeout expired".

Few days back applciation was working absolutly fine, but i was trying to make linked sever through windows account, i dnt know wat has i changed during achiveing that setup that now application (linked server) is not working even with sql account.

please help its urgent.

Check network setting. Can you ping from sql2k5 to sql2k. Also, how is the linked server login setup? Is it "self" or the remote credential? Remember that domain authentication requires a domain controller. Network latency might be your enemy here.

sql

Wednesday, March 21, 2012

Linked server from SQL2005 to SQL2000

Hi

I use the following SQL statements to create a link server. RemoteServerName is an SQL2000 and I am executing this in another machine which is SQL2005.

Though the link server is created successfully, I am not able to se the tables under it so could not query anything.

-

USE [master]

EXEC master.dbo.sp_addlinkedserver @.server = N'RemoteServerName\InstanceName', @.srvproduct=N'SQL Server'

EXEC master.dbo.sp_serveroption @.server=N'RemoteServerName\InstanceName', @.optname=N'collation compatible', @.optvalue=N'false'

EXEC master.dbo.sp_serveroption @.server=N'RemoteServerName\InstanceName', @.optname=N'data access', @.optvalue=N'true'

EXEC master.dbo.sp_serveroption @.server=N'RemoteServerName\InstanceName', @.optname=N'rpc',@.optvalue=N'false'

EXEC master.dbo.sp_serveroption @.server=N'RemoteServerName\InstanceName', @.optname=N'rpc out', @.optvalue=N'false'

EXEC master.dbo.sp_serveroption @.server=N'RemoteServerName\InstanceName', @.optname=N'connect timeout', @.optvalue=N'0'

EXEC master.dbo.sp_serveroption @.server=N'RemoteServerName\InstanceName', @.optname=N'collation name', @.optvalue=null

EXEC master.dbo.sp_serveroption @.server=N'RemoteServerName\InstanceName', @.optname=N'query timeout', @.optvalue=N'0'

EXEC master.dbo.sp_serveroption @.server=N'RemoteServerName\InstanceName', @.optname=N'use remote collation', @.optvalue=N'true'

EXEC master.dbo.sp_addlinkedsrvlogin @.rmtsrvname = N'RemoteServerName\InstanceName', @.locallogin = NULL , @.useself = N'False', @.rmtuser = N'remoteUser', @.rmtpassword = N'remotePassword'

Did you check permissions of remoteUser on the remote server instance? You can do this by just using the remote login to connect to the server using ISQLW and see what tables you can access or check your permissions.|||Yes, remoteUser is able to access RemoteServerName through Query Analizer.|||I didn't mean just accessing the server. That works since you didn't get any errors. What tables can you access? What happens if you try to select from a known table?|||

You have to use the Servername.Database.UserObject.Table on the query..

example,

Select * from [RemoteServer\MSSS2000].NorthWind.dbo.Orders

Linked Server for Oracle XE Database

Hello,
I have been able to create a linked server using the MSDAORA provider to an
Oracle XE Server. I have done so on the same machine as the Oracle XE
Server (also has a SQL server on it), and on another machine (with SQL
server and Oracle XE Client installed). The problem happens when I have do
anything to the Oracle database within a transaction. You see in order to
get this to work you need to point the MSDTC (Microsoft Distributed
Transaction Coordinator) to the correct Oracle DLLs. You can do this by
modifying the registry entries at the following location:
HKLM\Software\Microsoft\MSDTC\MTxOCI\
I could do so on the server with Oracle XE Server installed. I entered the
following values:
OracleOciLib = oci.dll
OracleSqlLib = orasql10.dll
OracleXaLib = oraclient10.dll
And everything worked fine. But on the server with the Oracle XE Client
installed, these files are not present, so what am I supposed to do? I
tried copying the files from the Oracle XE Server PC but it didn't fix
things. Has anyone had any success in configuring MSDTC for Oracle XE
Client?
Any help would be greatly appreciated.
Thanks.
-adamOkay, I have gotten around it by installing the Oracle 8i Client on the
server instead of the Oracle XE Client. This is hardly ideal, but it will
have to do until I can find a solution.
-adam
"Adam Byrne" <misterbyrne.nospam@.allforme.gmail.com> wrote in message
news:e3u5JVwjGHA.3440@.TK2MSFTNGP02.phx.gbl...
> Hello,
> I have been able to create a linked server using the MSDAORA provider to
> an Oracle XE Server. I have done so on the same machine as the Oracle XE
> Server (also has a SQL server on it), and on another machine (with SQL
> server and Oracle XE Client installed). The problem happens when I have
> do anything to the Oracle database within a transaction. You see in order
> to get this to work you need to point the MSDTC (Microsoft Distributed
> Transaction Coordinator) to the correct Oracle DLLs. You can do this by
> modifying the registry entries at the following location:
> HKLM\Software\Microsoft\MSDTC\MTxOCI\
> I could do so on the server with Oracle XE Server installed. I entered
> the following values:
> OracleOciLib = oci.dll
> OracleSqlLib = orasql10.dll
> OracleXaLib = oraclient10.dll
> And everything worked fine. But on the server with the Oracle XE Client
> installed, these files are not present, so what am I supposed to do? I
> tried copying the files from the Oracle XE Server PC but it didn't fix
> things. Has anyone had any success in configuring MSDTC for Oracle XE
> Client?
> Any help would be greatly appreciated.
> Thanks.
> -adam
>

Monday, March 19, 2012

linked server failed

hi,
i have added a link server but it fails when i try to retrieve data.
SQL server in on the same machine
i have created the another SQL server instance
Main Server: SERVER1
Instance: SERVER1/NewServer
EXEC sp_addlinkedserver @.server = SERVER1/NewServer, @.srvproduct = 'SQL
Server'
EXEC sp_addlinkedsrvlogin 'SERVER1/NewServer', false, NULL, 'sa', 'test'
select * from SERVER1/NewServer.db1.dbo.tbl_Prouduct
when i try to run the above query it gives me the error
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near '/'.
anyone have suggestion'
AdiAdi
Try
select * from [SERVER1/NewServer].db1.dbo.tbl_Prouduct
"Adi" <Adi@.discussions.microsoft.com> wrote in message
news:EA624DF8-B02E-4FC6-8E01-347B1AEC933D@.microsoft.com...
> hi,
> i have added a link server but it fails when i try to retrieve data.
> SQL server in on the same machine
> i have created the another SQL server instance
> Main Server: SERVER1
> Instance: SERVER1/NewServer
> EXEC sp_addlinkedserver @.server = SERVER1/NewServer, @.srvproduct = 'SQL
> Server'
> EXEC sp_addlinkedsrvlogin 'SERVER1/NewServer', false, NULL, 'sa', 'test'
> select * from SERVER1/NewServer.db1.dbo.tbl_Prouduct
> when i try to run the above query it gives me the error
> Server: Msg 170, Level 15, State 1, Line 1
> Line 1: Incorrect syntax near '/'.
>
> anyone have suggestion'
> Adi
>|||yes i tried this too but it gives me the message:
SQL Server Does not exists or access denied.
i have also checked the sysservers the linked server is exist in it.
when i try to run retrieve data from main server its working fine but when i
try to retrieve data from SQL Server instance it failed.
"Uri Dimant" wrote:
> Adi
> Try
> select * from [SERVER1/NewServer].db1.dbo.tbl_Prouduct
> "Adi" <Adi@.discussions.microsoft.com> wrote in message
> news:EA624DF8-B02E-4FC6-8E01-347B1AEC933D@.microsoft.com...
> > hi,
> > i have added a link server but it fails when i try to retrieve data.
> >
> > SQL server in on the same machine
> > i have created the another SQL server instance
> >
> > Main Server: SERVER1
> > Instance: SERVER1/NewServer
> >
> > EXEC sp_addlinkedserver @.server = SERVER1/NewServer, @.srvproduct = 'SQL
> > Server'
> > EXEC sp_addlinkedsrvlogin 'SERVER1/NewServer', false, NULL, 'sa', 'test'
> >
> > select * from SERVER1/NewServer.db1.dbo.tbl_Prouduct
> >
> > when i try to run the above query it gives me the error
> > Server: Msg 170, Level 15, State 1, Line 1
> > Line 1: Incorrect syntax near '/'.
> >
> >
> > anyone have suggestion'
> > Adi
> >
>
>|||I Anthony.
I have the same problem of Adi (SQL Server Does not exists or access
denied), but my server name is nsv, so the problem is not the slash.
The likend server it seems to be created correctly.
Any suggestion?
"AnthonyThomas" wrote:
> Try looking up the CORRECT syntax in Books Online.
> You are using the wrong slash.
> Try [Server1\NewServer].
> Sincerely,
>
> Anthony Thomas
>
> --
> "Adi" <Adi@.discussions.microsoft.com> wrote in message news:2C6DA00D-ACDE-44D0-AC42-F6F3DC34D58C@.microsoft.com...
> yes i tried this too but it gives me the message:
> SQL Server Does not exists or access denied.
> i have also checked the sysservers the linked server is exist in it.
> when i try to run retrieve data from main server its working fine but when i
> try to retrieve data from SQL Server instance it failed.
>
> "Uri Dimant" wrote:
> > Adi
> > Try
> > select * from [SERVER1/NewServer].db1.dbo.tbl_Prouduct
> >
> > "Adi" <Adi@.discussions.microsoft.com> wrote in message
> > news:EA624DF8-B02E-4FC6-8E01-347B1AEC933D@.microsoft.com...
> > > hi,
> > > i have added a link server but it fails when i try to retrieve data.
> > >
> > > SQL server in on the same machine
> > > i have created the another SQL server instance
> > >
> > > Main Server: SERVER1
> > > Instance: SERVER1/NewServer
> > >
> > > EXEC sp_addlinkedserver @.server = SERVER1/NewServer, @.srvproduct = 'SQL
> > > Server'
> > > EXEC sp_addlinkedsrvlogin 'SERVER1/NewServer', false, NULL, 'sa', 'test'
> > >
> > > select * from SERVER1/NewServer.db1.dbo.tbl_Prouduct
> > >
> > > when i try to run the above query it gives me the error
> > > Server: Msg 170, Level 15, State 1, Line 1
> > > Line 1: Incorrect syntax near '/'.
> > >
> > >
> > > anyone have suggestion'
> > > Adi
> > >
> >
> >
> >

Linked Server Error

Hello,
I have installed IBM AS/400 Client Access on my machine and then added a new
ODBC Data Source.
I have been working with this ODBC connection on several DTS packages and
everything has worked just fine.
Right now, I need to access some information on my AS/400 server from
several stored procedures on my SQL Server. I already configured a Linked
Server to the AS/400 server using the Microsoft OLE DB Provider for ODBC
Driver.
When I click the Tables folder under the new linked server, I can browse
through all the tables on the 400 Database. But when I execute any query
(using OPENQUERY or 4-part names in a normal query) I get the following erro
r:
****************************************
***+++
Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'MSDASQL' reported an error.
[OLE/DB provider returned message: [IBM][Client Access Express ODBC Driver
(32 bits)] Driver not capable.]
OLE DB error trace [OLE/DB Provider 'MSDASQL' IRowset::GetNextRows returned
0x80004005: ].
****************************************
**
Why is this happening? What is the error? Is there anything I am doing
wrong? I have been "fighting" with this problem for several hours.
Thanks a lot, in advance, for all the help you can give me.Gabriel --
See if this thread helps at all:
http://www.mcse.ms/message979460.html
same thread, different format:
http://www.newsarch.com/archive/new...
54.html
Gabriel Giraldo wrote:
> Hello,
> I have installed IBM AS/400 Client Access on my machine and then added a n
ew
> ODBC Data Source.
> I have been working with this ODBC connection on several DTS packages and
> everything has worked just fine.
> Right now, I need to access some information on my AS/400 server from
> several stored procedures on my SQL Server. I already configured a Linked
> Server to the AS/400 server using the Microsoft OLE DB Provider for ODBC
> Driver.
> When I click the Tables folder under the new linked server, I can browse
> through all the tables on the 400 Database. But when I execute any query
> (using OPENQUERY or 4-part names in a normal query) I get the following er
ror:
> ****************************************
***+++
> Server: Msg 7399, Level 16, State 1, Line 1
> OLE DB provider 'MSDASQL' reported an error.
> [OLE/DB provider returned message: [IBM][Client Access Express ODBC Driver
> (32 bits)] Driver not capable.]
> OLE DB error trace [OLE/DB Provider 'MSDASQL' IRowset::GetNextRows returne
d
> 0x80004005: ].
> ****************************************
**
> Why is this happening? What is the error? Is there anything I am doing
> wrong? I have been "fighting" with this problem for several hours.
> Thanks a lot, in advance, for all the help you can give me.
>|||It has been awhile since I worked with the AS/400. Based on the error
message, I would look at the client software installed on the SQL end. The
second thing to look at is the syntax used to attempt to get data. As long a
s
the SQL is fully ANSI standard, you should be fine on both ends; if not, the
likelihood of error increases.
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
***************************
Think Outside the Box!
***************************
"Gabriel Giraldo" wrote:

> Hello,
> I have installed IBM AS/400 Client Access on my machine and then added a n
ew
> ODBC Data Source.
> I have been working with this ODBC connection on several DTS packages and
> everything has worked just fine.
> Right now, I need to access some information on my AS/400 server from
> several stored procedures on my SQL Server. I already configured a Linked
> Server to the AS/400 server using the Microsoft OLE DB Provider for ODBC
> Driver.
> When I click the Tables folder under the new linked server, I can browse
> through all the tables on the 400 Database. But when I execute any query
> (using OPENQUERY or 4-part names in a normal query) I get the following er
ror:
> ****************************************
***+++
> Server: Msg 7399, Level 16, State 1, Line 1
> OLE DB provider 'MSDASQL' reported an error.
> [OLE/DB provider returned message: [IBM][Client Access Express ODBC Driver
> (32 bits)] Driver not capable.]
> OLE DB error trace [OLE/DB Provider 'MSDASQL' IRowset::GetNextRows returne
d
> 0x80004005: ].
> ****************************************
**
> Why is this happening? What is the error? Is there anything I am doing
> wrong? I have been "fighting" with this problem for several hours.
> Thanks a lot, in advance, for all the help you can give me.
>

Friday, March 9, 2012

Linked Server B/w two SQL SERVER 05 instances (on differnt pc;s) VERY URGENT

I created a linked server named CONFUSION (as the machine name with perticular IP say a.b.c.d)

TESTED the connection by

USE master
GO
EXEC sp_configure 'show advanced options', 1
GO
RECONFIGURE WITH OVERRIDE
GO
EXEC sp_configure 'xp_cmdshell', 1
GO
RECONFIGURE WITH OVERRIDE
GO
EXEC sp_configure 'show advanced options', 0
GO

CREATE TABLE #foo
(
pingResult SYSNAME NULL
);

INSERT #foo
EXEC master..xp_cmdshell
'ping CONFUSION';

IF EXISTS
(
SELECT 1
FROM #foo
WHERE pingResult LIKE '%TTL%'
)
BEGIN
PRINT 'Feel free to use linked server.';
END
ELSE
BEGIN
PRINT 'Linked server not available.';
END

DROP TABLE #foo;

I executed the above code and the result was :::

(13 row(s) affected)
Feel free to use linked server.

THAT means my linked server is perfect :::

but when I write the query

select * from CONFUSION.coindb.dbo.test

output is

Msg 18456, Level 14, State 1, Line 1
Login failed for user 'pss2600'.
- INFO --
pss2600 is a user in both sql servers (with all previlages) and I am loged in as root on both machines, while creating a linked server I choosed the option "be made using the security context" user : pss2600 and pwd: XXXX.

What am I doing wrong ?
in both the servers I have the coindb database with the table test.

ITS VERY VERY URGENT

Are you using SQL Server authentication?

...on both servers?

If so does the user have the same password on both servers?

|||You haven't mentioned the SQL server version being used here, I believe there was some issue previous version of SQL.|||I am using SQL Server 2005 on both servers and also authentication mode is ( both ) that is window + SQL Server authentication mode.

user:

I can login into the machine in two ways:

1. As admin (of that machine - local)
2. user of the whole network (which includes UNIX machines + Windows + Mac)

In this perticular case, I logged in into the machies (both ) as admin and when I created a linked server I used the user name and password by which I can login into any machine (network user)

I also created the same user in sql server too (with same password I use to loggin into the network).

Thanks for your replies please let me know if you want any other details too

Pardeep|||

Sorry this isn't helping...

If pss2600 is a Login (servers have logins, databases have users) on both servers

and

pss2600 is created as a Login with SQL Server Authentication on both servers.

and

pss2600 has the same SQL Server Authentication password on both servers

and

you use the "Be made using this security context " option as shown in this quote from Books Online:

Be made using this security context

Specify that a connection will be made using the login and password specified in the Remote login and With password boxes for logins not defined in the list. The remote login must be a SQL Server Authentication login on the remote server.

You should not see the error.

The login you used to create the Linked Server is unimportant.

|||Even I have seen many articles and issues like these, but this is weired.

Can you tell me any way by which I can check (with or without liked server) if I can connect to say server A (SQL Server 2005) from machine say server B.

kinda of remote login (right that what we say). There could be the problem that, server A does not accept remote connection ? how to check this ? and what could be the solution if that what the case is.

Thanks for your response, but its still not working !!|||

I would expect to see a no remote connections allowed error before a Login failed error.

You could try this adhoc alternative to a linked server:
OPENROWSET (Transact-SQL)
http://msdn2.microsoft.com/en-us/library/ms190312.aspx

The Ping test you show should work with any server, linked or not.

Can you use your linked server with any account, say sysadmin or Windows account that is a Login on both servers.

Can you login to both servers from SSMS on both servers?

|||Dear LKH

YOU WROTE

"pss2600 is created as a Login with SQL Server Authentication on both servers."

Though, I selected the option "both SQL Server Authentication and Window Authentication" as previously it was on Window Authentication mode, I actually did not made a separate user with the same login ID and PWD in SQL Server Authentication mode.

THANK A LOTS !!!

now the query

select * from CONFUSION.coindb.dbo.test UNION select * from test

WORKS perfectly !!!!!
-
NOW I have to build an C# application over it (just to demonstrate my senior that it works)
I will get back to you, If you had any problem .. THANKS a lots again !!!

Pardeep
|||Hello lkh

NOW, we have a third server in the picture that is Oracle 10g XE in the same LAN.
I created a same table test(name varchar(10)) in Oracle 10g XE by login pss2600 in windows as well as in 10g. (machine name on which 10 g XE is 'don'

I created a linked server to 10g as follow

1. Right click on linked server, create new linked server
Linked Server : SERVER2
other data source : Microsoft OLEDB DB Provider for Oracle
Data sourse : don
provider string : OraOLEDB.Oracle

security :
be made using security context
username : pss2600 , pwd : same every where
Server options : rcp true, rpc out true, data access true

and if I run this now :

CREATE TABLE #foo
(
pingResult SYSNAME NULL
);

INSERT #foo
EXEC master..xp_cmdshell
'ping SERVER2';

IF EXISTS
(
SELECT 1
FROM #foo
WHERE pingResult LIKE '%TTL%'
)
BEGIN
PRINT 'Feel free to use linked server.';
END
ELSE
BEGIN
PRINT 'Linked server not available.';
END

it shows :

(2 row(s) affected)
Linked server not available.

every thing else is same, like firewall is turned off ..

I will really appreciate if you can get me out of this too.

Pardeep|||

For testing the linked server connectivity you can use the following stored procedure

sp_testlinkedserver [ @.servername ] = servername.

If this command works then there should not be any problem in accessing the data from linked server.

|||Hi ,

sp_testlinkedserver @.server = SERVER2

doest work. What I think is its because I am not setting up the Linked Server as it is supposed to be with Oracle 10g XE.

if you know any good articles or anyone got into same problem, that will aslo be help

I have already seen http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1040216&SiteID=1

but I was unable to make it working !!!!

Thanks for replying Rajesh|||

I copied your ping test to my machine and I can successfully ping any server in my domain even though it is not a linked server. So, if you get Linked server not available that tells me that the two servers can't talk regarless of their being linked.

Here is a link on Oracle linked servers in case you haven't already found it:

http://support.microsoft.com/kb/280106

My next check would be correct premissions in Oracle but it has been a few years since I worked with 9g

Rajesh is correct about sp_testlinkedserver [ @.servername ] = servername, with this caution in Books Online:

"No permissions are checked; however, the caller must have the appropriate login mapping."

Linked server and MDAC driver.

Hi,
I have developed a database on my local Win Xp machine, using Express
version of SQL server.
The database is using a linked server to an Oracle database. On the XP
machin I have used the "Microsoft OLE DB Provider for Oracle" as the driver
for the linked server.
Now I'm trying to port this version to full SQL server 2005 on a Windows
2003 Server, but it seems that the driver is not installed(only the Oracle
driver). On MSDN I read that MDAC is installed with the OS on windows 2003
server.
Anyone knows how to enable the Microsoft OLE DB Provider for Oracle on
Windows Server 2003?
Thanks!
D.
Hi
"Dahab" wrote:

> Hi,
> I have developed a database on my local Win Xp machine, using Express
> version of SQL server.
> The database is using a linked server to an Oracle database. On the XP
> machin I have used the "Microsoft OLE DB Provider for Oracle" as the driver
> for the linked server.
> Now I'm trying to port this version to full SQL server 2005 on a Windows
> 2003 Server, but it seems that the driver is not installed(only the Oracle
> driver). On MSDN I read that MDAC is installed with the OS on windows 2003
> server.
> Anyone knows how to enable the Microsoft OLE DB Provider for Oracle on
> Windows Server 2003?
> Thanks!
> D.
>
I would expect these to be part of the Connectivity Components which you can
add from the command prompt using the ADDLOCAL parameter.
John
|||Dahab wrote:
> Hi,
> I have developed a database on my local Win Xp machine, using Express
> version of SQL server.
> The database is using a linked server to an Oracle database. On the XP
> machin I have used the "Microsoft OLE DB Provider for Oracle" as the driver
> for the linked server.
> Now I'm trying to port this version to full SQL server 2005 on a Windows
> 2003 Server, but it seems that the driver is not installed(only the Oracle
> driver). On MSDN I read that MDAC is installed with the OS on windows 2003
> server.
> Anyone knows how to enable the Microsoft OLE DB Provider for Oracle on
> Windows Server 2003?
> Thanks!
> D.
>
Is it by any change a 64-bit installation you are using? The MSDAORA
provider doesn't exists on the 64-bit version. Instead you should use
the Oracle ODAC which is the OraOledb.Oracle provider. You should also
be aware that the MSDAORA hasn't been enhanced since Oracle 8 client and
there are a number of things that isn't supported in this provider.
You can take a look at the link below which is a document that gives a
pretty good overview over the various connectivity options.
http://msdn2.microsoft.com/en-us/library/bb332055.aspx
Regards
Steen Schlter Persson
Database Administrator / System Administrator
|||Hi Steen,
Yes it's a 64bit server.
So I have to figure out how to use the Oracle driver then. Gave it a try a
few days ago with no luck ...
Thanks very much Steen.
D.
""Steen Schlter Persson (DK)"" <steen@.REMOVE_THIS_asavaenget.dk> wrote in
message news:uKBKiD8iHHA.2272@.TK2MSFTNGP02.phx.gbl...
> Dahab wrote:
> Is it by any change a 64-bit installation you are using? The MSDAORA
> provider doesn't exists on the 64-bit version. Instead you should use the
> Oracle ODAC which is the OraOledb.Oracle provider. You should also be
> aware that the MSDAORA hasn't been enhanced since Oracle 8 client and
> there are a number of things that isn't supported in this provider.
> You can take a look at the link below which is a document that gives a
> pretty good overview over the various connectivity options.
> http://msdn2.microsoft.com/en-us/library/bb332055.aspx
> --
> Regards
> Steen Schlter Persson
> Database Administrator / System Administrator
|||Dahab wrote:
> Hi Steen,
> Yes it's a 64bit server.
> So I have to figure out how to use the Oracle driver then. Gave it a try a
> few days ago with no luck ...
> Thanks very much Steen.
> D.
It's not that big a problem to use the Oracle driver. You'll have to
download the ODAC (
http://www.oracle.com/technology/software/tech/windows/odpnet/64-bit/index.html)
and then make the entries in the tnsnames.ora file. Then you can use the
OraOledb.Oracle provider for setting up your Linked Server.
Regards
Steen Schlter Persson
Database Administrator / System Administrator

Linked server and MDAC driver.

Hi,
I have developed a database on my local Win Xp machine, using Express
version of SQL server.
The database is using a linked server to an Oracle database. On the XP
machin I have used the "Microsoft OLE DB Provider for Oracle" as the driver
for the linked server.
Now I'm trying to port this version to full SQL server 2005 on a Windows
2003 Server, but it seems that the driver is not installed(only the Oracle
driver). On MSDN I read that MDAC is installed with the OS on windows 2003
server.
Anyone knows how to enable the Microsoft OLE DB Provider for Oracle on
Windows Server 2003?
Thanks!
D.Hi
"Dahab" wrote:
> Hi,
> I have developed a database on my local Win Xp machine, using Express
> version of SQL server.
> The database is using a linked server to an Oracle database. On the XP
> machin I have used the "Microsoft OLE DB Provider for Oracle" as the driver
> for the linked server.
> Now I'm trying to port this version to full SQL server 2005 on a Windows
> 2003 Server, but it seems that the driver is not installed(only the Oracle
> driver). On MSDN I read that MDAC is installed with the OS on windows 2003
> server.
> Anyone knows how to enable the Microsoft OLE DB Provider for Oracle on
> Windows Server 2003?
> Thanks!
> D.
>
I would expect these to be part of the Connectivity Components which you can
add from the command prompt using the ADDLOCAL parameter.
John|||Dahab wrote:
> Hi,
> I have developed a database on my local Win Xp machine, using Express
> version of SQL server.
> The database is using a linked server to an Oracle database. On the XP
> machin I have used the "Microsoft OLE DB Provider for Oracle" as the driver
> for the linked server.
> Now I'm trying to port this version to full SQL server 2005 on a Windows
> 2003 Server, but it seems that the driver is not installed(only the Oracle
> driver). On MSDN I read that MDAC is installed with the OS on windows 2003
> server.
> Anyone knows how to enable the Microsoft OLE DB Provider for Oracle on
> Windows Server 2003?
> Thanks!
> D.
>
Is it by any change a 64-bit installation you are using? The MSDAORA
provider doesn't exists on the 64-bit version. Instead you should use
the Oracle ODAC which is the OraOledb.Oracle provider. You should also
be aware that the MSDAORA hasn't been enhanced since Oracle 8 client and
there are a number of things that isn't supported in this provider.
You can take a look at the link below which is a document that gives a
pretty good overview over the various connectivity options.
http://msdn2.microsoft.com/en-us/library/bb332055.aspx
--
Regards
Steen Schlüter Persson
Database Administrator / System Administrator|||Hi Steen,
Yes it's a 64bit server.
So I have to figure out how to use the Oracle driver then. Gave it a try a
few days ago with no luck :(...
Thanks very much Steen.
D.
""Steen Schlüter Persson (DK)"" <steen@.REMOVE_THIS_asavaenget.dk> wrote in
message news:uKBKiD8iHHA.2272@.TK2MSFTNGP02.phx.gbl...
> Dahab wrote:
>> Hi,
>> I have developed a database on my local Win Xp machine, using Express
>> version of SQL server.
>> The database is using a linked server to an Oracle database. On the XP
>> machin I have used the "Microsoft OLE DB Provider for Oracle" as the
>> driver for the linked server.
>> Now I'm trying to port this version to full SQL server 2005 on a Windows
>> 2003 Server, but it seems that the driver is not installed(only the
>> Oracle driver). On MSDN I read that MDAC is installed with the OS on
>> windows 2003 server.
>> Anyone knows how to enable the Microsoft OLE DB Provider for Oracle on
>> Windows Server 2003?
>> Thanks!
>> D.
> Is it by any change a 64-bit installation you are using? The MSDAORA
> provider doesn't exists on the 64-bit version. Instead you should use the
> Oracle ODAC which is the OraOledb.Oracle provider. You should also be
> aware that the MSDAORA hasn't been enhanced since Oracle 8 client and
> there are a number of things that isn't supported in this provider.
> You can take a look at the link below which is a document that gives a
> pretty good overview over the various connectivity options.
> http://msdn2.microsoft.com/en-us/library/bb332055.aspx
> --
> Regards
> Steen Schlüter Persson
> Database Administrator / System Administrator|||Dahab wrote:
> Hi Steen,
> Yes it's a 64bit server.
> So I have to figure out how to use the Oracle driver then. Gave it a try a
> few days ago with no luck :(...
> Thanks very much Steen.
> D.
It's not that big a problem to use the Oracle driver. You'll have to
download the ODAC (
http://www.oracle.com/technology/software/tech/windows/odpnet/64-bit/index.html)
and then make the entries in the tnsnames.ora file. Then you can use the
OraOledb.Oracle provider for setting up your Linked Server.
--
Regards
Steen Schlüter Persson
Database Administrator / System Administrator

Linked server and MDAC driver.

Hi,
I have developed a database on my local Win Xp machine, using Express
version of SQL server.
The database is using a linked server to an Oracle database. On the XP
machin I have used the "Microsoft OLE DB Provider for Oracle" as the driver
for the linked server.
Now I'm trying to port this version to full SQL server 2005 on a Windows
2003 Server, but it seems that the driver is not installed(only the Oracle
driver). On MSDN I read that MDAC is installed with the OS on windows 2003
server.
Anyone knows how to enable the Microsoft OLE DB Provider for Oracle on
Windows Server 2003?
Thanks!
D.Hi
"Dahab" wrote:

> Hi,
> I have developed a database on my local Win Xp machine, using Express
> version of SQL server.
> The database is using a linked server to an Oracle database. On the XP
> machin I have used the "Microsoft OLE DB Provider for Oracle" as the drive
r
> for the linked server.
> Now I'm trying to port this version to full SQL server 2005 on a Windows
> 2003 Server, but it seems that the driver is not installed(only the Oracle
> driver). On MSDN I read that MDAC is installed with the OS on windows 2003
> server.
> Anyone knows how to enable the Microsoft OLE DB Provider for Oracle on
> Windows Server 2003?
> Thanks!
> D.
>
I would expect these to be part of the Connectivity Components which you can
add from the command prompt using the ADDLOCAL parameter.
John|||Dahab wrote:
> Hi,
> I have developed a database on my local Win Xp machine, using Express
> version of SQL server.
> The database is using a linked server to an Oracle database. On the XP
> machin I have used the "Microsoft OLE DB Provider for Oracle" as the drive
r
> for the linked server.
> Now I'm trying to port this version to full SQL server 2005 on a Windows
> 2003 Server, but it seems that the driver is not installed(only the Oracle
> driver). On MSDN I read that MDAC is installed with the OS on windows 2003
> server.
> Anyone knows how to enable the Microsoft OLE DB Provider for Oracle on
> Windows Server 2003?
> Thanks!
> D.
>
Is it by any change a 64-bit installation you are using? The MSDAORA
provider doesn't exists on the 64-bit version. Instead you should use
the Oracle ODAC which is the OraOledb.Oracle provider. You should also
be aware that the MSDAORA hasn't been enhanced since Oracle 8 client and
there are a number of things that isn't supported in this provider.
You can take a look at the link below which is a document that gives a
pretty good overview over the various connectivity options.
http://msdn2.microsoft.com/en-us/library/bb332055.aspx
Regards
Steen Schlter Persson
Database Administrator / System Administrator|||Hi Steen,
Yes it's a 64bit server.
So I have to figure out how to use the Oracle driver then. Gave it a try a
few days ago with no luck ...
Thanks very much Steen.
D.
""Steen Schlter Persson (DK)"" <steen@.REMOVE_THIS_asavaenget.dk> wrote in
message news:uKBKiD8iHHA.2272@.TK2MSFTNGP02.phx.gbl...
> Dahab wrote:
> Is it by any change a 64-bit installation you are using? The MSDAORA
> provider doesn't exists on the 64-bit version. Instead you should use the
> Oracle ODAC which is the OraOledb.Oracle provider. You should also be
> aware that the MSDAORA hasn't been enhanced since Oracle 8 client and
> there are a number of things that isn't supported in this provider.
> You can take a look at the link below which is a document that gives a
> pretty good overview over the various connectivity options.
> http://msdn2.microsoft.com/en-us/library/bb332055.aspx
> --
> Regards
> Steen Schlter Persson
> Database Administrator / System Administrator|||Dahab wrote:
> Hi Steen,
> Yes it's a 64bit server.
> So I have to figure out how to use the Oracle driver then. Gave it a try a
> few days ago with no luck ...
> Thanks very much Steen.
> D.
It's not that big a problem to use the Oracle driver. You'll have to
download the ODAC (
[url]http://www.oracle.com/technology/software/tech/windows/odpnet/64-bit/index.html[/u
rl])
and then make the entries in the tnsnames.ora file. Then you can use the
OraOledb.Oracle provider for setting up your Linked Server.
Regards
Steen Schlter Persson
Database Administrator / System Administrator

Linked Server and Distributed Query

I have a linked SQL Server on another machine which is created using a stored procedure that executes the following:

EXEC sp_addlinkedserver @.server = 'Achilles\Mixed', @.srvproduct = ' ', @.provider = 'SQLNCLI', @.datasrc = 'Archilles\Mixed', @.catalog = 'DB_INTRANET'

The stored procedure executes successfully and I can also succesfully DROP the linked server. However when I try to query tables in linked databases using:

SELECT * FROM DB_INTRANET...Employees

I get the following error:

OLE DB provider "SQLNCLI" for linked server "DB_Intranet" returned message "Communication link failure".

Msg 10054, Level 16, State 1, Line 0 TCP Provider: An existing connection was forcibly closed by the remote host.

Msg 18452, Level 14, State 1, Line 0 Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.

The logins are Windows Authentication and even if I use sp_addlinkedsrvlogin to map logins it still gives me the same error.

I have no problems linking and querying linked Access Databases but can't do it for the SQL Server DBs.

Does anyone have any suggestions please.

Hi,

the mapping of the logins did not work. What command did you use to use the WIndows login on the other server ?

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

|||

I am a user with windows authenticated login on both servers. I can login to both using SQL Server management Studio and have full rights on all databases. I did use any command to use windows login as I though it would be the default. Do I need to execute a command to use windows logon. It is a mixed mode server but I login OK with windows authentication using the client tools.

Thanks for your help.

Monday, February 20, 2012

Linked Server

I want to setup a linked server to MS Access.
If my MS Access file in different machine, on EM, once I got into the New
Linked Server page, General tab, what should I enter to the boxes:
Product name, Data source and Provider string ?
Have a look in BOL for sp_addlinkedserver, EG
EXEC sp_addlinkedserver
@.server = 'SEATTLE Mktg',
@.provider = 'Microsoft.Jet.OLEDB.4.0',
@.srvproduct = 'OLE DB Provider for Jet',
@.datasrc = 'C:\MSOffice\Access\Samples\Northwind.mdb'
GO
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||Is @.server arbitrary ? Any string can work ?
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:uZEcigd5FHA.552@.TK2MSFTNGP10.phx.gbl...
> Have a look in BOL for sp_addlinkedserver, EG
> EXEC sp_addlinkedserver
> @.server = 'SEATTLE Mktg',
> @.provider = 'Microsoft.Jet.OLEDB.4.0',
> @.srvproduct = 'OLE DB Provider for Jet',
> @.datasrc = 'C:\MSOffice\Access\Samples\Northwind.mdb'
> GO
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>
|||Yes
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)