473,402 Members | 2,064 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

How to handle this Linked Server error trap in SQL2K?

Below is the script. The problem is when I simulated the Oracle link
drop, my SQL2K never have to a chance to head to the GOTO section as it
dies with this error msg and exit. Any idea on a workround? Thanks.

Server: Msg 7399, Level 16, State 1, Procedure USP_Link_Check, Line 8
OLE DB provider 'MSDAORA' reported an error.
[OLE/DB provider returned message: ORA-12154: TNS:could not resolve
service name
]
OLE DB error trace [OLE/DB Provider 'MSDAORA' IDBInitialize::Initialize
returned 0x80004005: ].
----------------------------------------------
ALTER PROCEDURE [USP_Link_Check] AS

DECLARE @myERROR int -- Local @@ERROR
, @myRowCount int -- Local @@ROWCOUNT

--- Verify network connections
select *
from openquery(OraLink,'select count(*) from Oracle.table')
IF @myERROR != 0 GOTO HANDLE_ERROR

HANDLE_ERROR:
Print ' Error in Oracle Link'
RETURN @myERROR
---------------------------------------------

Jul 23 '05 #1
1 3026
Warren (Nh***@Lieu.org) writes:
Below is the script. The problem is when I simulated the Oracle link
drop, my SQL2K never have to a chance to head to the GOTO section as it
dies with this error msg and exit. Any idea on a workround? Thanks.


Not very many. Error handling in SQL 2000 is a messy story, and many
errors are not catchable in SQL, as the entire batcb aborts. This appears
to be one of these errors.

It all gets better in SQL 2005...

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Jack Smith | last post by:
I am unable to connect to certain SQL servers from PHP on IIS. I have two IIS 5 servers, both are Windows 2000 Server boxes with PHP 4.3.4 and MDAC 2.80.1022.3. I have three SQL Server machines...
2
by: gg | last post by:
hi group, i previously have a single machine development environment on server03 (w2K3, stand alone, SQL2K). i configured it so that my app is using "NT AUTHORITY\NETWORK SERVICE" to access to...
3
by: dpower | last post by:
Hi, Currently on IIS 5 win2k we use SQL2k Client network utility for the network libraries to connect and encrypt our data to our back end SQL DB. 2003 web edition doesn't allow me to install the...
4
by: Hank | last post by:
I have two SQL Server 2000 machines (server_A and server_B). I've used sp_addlinkedserver to link them both, the link seems to behave fine. I can execute remote queries and do all types of neat...
1
by: ConTactMe | last post by:
I get the following error when trying to create an Access Data Project: Login failed for user 'myname'. Reason: Not associated with a trusted SQL Server connection. I'm using a specific...
2
by: LB | last post by:
Anyone encounter differences between SQL2K EE and SQL2K Dev Editon? FAILS ----- Machine_A <-- JDBC --> Machine_A\SQL2K_Dev_Ed..db Error: "com.inet.tds.SQLException: Connection refused" ...
0
by: md | last post by:
Hi, I'm trying to run a stored procedure with linked servers on Sql2k over a broadband connection where sql server is setup for port forwarding and am getting the error :- Server: Msg 7391,...
1
by: annie | last post by:
Hi all, I have recently ported my Access 2000 app to SQL Server, keeping the Access client as the front end using linked tables. I am also using triggers on my SQL tables to trap orphan...
14
by: Abhi | last post by:
FYI: This message is for the benefit of MS Access Community. I found that this prblem has been encounterd by many but there is hardly any place where a complete solution is posted. So I thought...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.