473,508 Members | 2,361 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to detect and recognize an error returned by Stored Procedures on SQL Server.

ab
In my ASP page I'm calling a Stored Procedure on my SQL Server. No
problem. But I want to check if my SP returned an error (and what kind
of error) instead of the required result.
To call the SP I'm using the code on
http://support.microsoft.com/kb/q164485

All hints are appreciated.

Aug 2 '06 #1
3 1588
use Try-Catch block?

"ab" wrote:
In my ASP page I'm calling a Stored Procedure on my SQL Server. No
problem. But I want to check if my SP returned an error (and what kind
of error) instead of the required result.
To call the SP I'm using the code on
http://support.microsoft.com/kb/q164485

All hints are appreciated.

Aug 2 '06 #2
No try-catch available in vbscript (I don't think). Any errors thrown
from SQL Server should bubble up to your code without any special work
from you.

However, if you don't have an "on error goto somelabel" then your code
will try to continue until it finally hits a fatal error. Now my ASP
is a bit rusty but I'm pretty sure thats how it works. Hope this
helps.

Augustin Prasanna wrote:
use Try-Catch block?

"ab" wrote:
In my ASP page I'm calling a Stored Procedure on my SQL Server. No
problem. But I want to check if my SP returned an error (and what kind
of error) instead of the required result.
To call the SP I'm using the code on
http://support.microsoft.com/kb/q164485

All hints are appreciated.
Aug 2 '06 #3
ab
Thanks, I'll give it a try

Aug 2 '06 #4

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

Similar topics

11
7564
by: David Berry | last post by:
Hi All. I have a SQL Statement on an ASP page that only returns 4 records. When I run it in SQL Server or Query Analyzer it runs in less than a second. When I run it from my ASP page I get: ...
4
2785
by: Racer-D | last post by:
When some of the SQL Server stored procedures I have written are called via my Classic ASP page I have written I get the following error in the cell that is supposed to be retrieving a single...
0
2992
by: Larry | last post by:
I know how to detect errors if a stored procedure is used, by adding a ReturnValue parameter to the command object and then in the stored procedure having a RETURN @@ERROR But, If I am using...
6
2387
by: amitavabardhan | last post by:
How can I return an error code from a sql server stored procedure and use it in my asp page to generate an alert indicating that some error has ocurred?
9
10284
by: dtwilliams | last post by:
OK, i'm trying to do some error checking on stored procedures and am following the advise in Erland Sommarskog's 'Implementing Error Handling with Stored Procedures' document. Can anybody help...
5
3459
by: Tim Marshall | last post by:
I was following the thread "Re: Access Treeview - Is it Safe Yet?" with interest and on reading the post describing Lauren Quantrell's SmartTree, I've run into something I don't understand: Stored...
4
6684
by: Jack | last post by:
Hi, I am trying to run an example code from a book. However I am getting the following error message: Number: -2147217900 Description: Syntax error or access violation Source: Microsoft OLE...
28
72329
by: mooreit | last post by:
The purpose for my questions is accessing these technologies from applications. I develop both applications and databases. Working with Microsoft C#.NET and Microsoft SQL Server 2000 Production and...
1
2149
by: barmatt80 | last post by:
I have found alot of help on this site, and is helping me along. I am having trouble with a stored procedure. This is my first stored procedure. The task I was given was to create a stored...
0
7115
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
7321
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
7377
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7036
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5624
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,...
0
4705
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.