Getting error message using error number

This probably is a silly question -
Can anybody tell me how to trap an error message that is returned from
the database inside a stored procedure? I am able to trap the error
using the global var @@error, but dont seem to find any such thing for
the text of the error message. I also am able to get the text of the
corresponding error number from master..sysmessages, but then, the
placeholders are empty.

Any help is appreciated

Thanks

0
Arviind
8/10/1998 5:56:11 PM
sybase.sqlserver.nt 2169 articles. 0 followers. Follow

1 Replies
1145 Views

Similar Articles

[PageSpeed] 9
Get it on Google Play
Get it on Apple App Store

Arviind Rajan wrote:
> 
> This probably is a silly question -
> Can anybody tell me how to trap an error message that is returned from
> the database inside a stored procedure? I am able to trap the error
> using the global var @@error, but dont seem to find any such thing for
> the text of the error message. I also am able to get the text of the
> corresponding error number from master..sysmessages, but then, the
> placeholders are empty.
> 
> Any help is appreciated
> 
> Thanks

Hi Arviind,

You need to save @@error in a local variable (ex: @myerror) and check
that against sysmessages.

Hope this helps,

AnaMaria Stirbet
Sybase TS
0
AnaMaria
8/10/1998 6:34:56 PM
Reply:

Similar Artilces:

error error error
These are the 2 new errors i am getting now:   1).  Server Error in '/' Application. Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.Source Error: Line 53: ...

Error, Error and more errors
Okay, all I wanted to do was test this app out and it has been a nightmare. 1.) Didn't install the sql database. I had to manually install it. 2.) I get errors when trying to add a picture to an album. "Procedure or function ngUpdatePicture has too many arguments specified" Any ideas? I've gotten more errors than this, but there is no use in bitchin. Are you using the v1.6.1 installer? Also, did you select to install the SQL Server db and give it a valid admin login? What were some of the error messages? Did you have an existing DB from a previous install? ...

errors errors errors..
Name: harun Email: harunbjk1903hrnatgmaildotcom Product: Firefox Summary: errors errors errors.. Comments: first of all when i launch firefox (3) i cant enter websites via writing.. for example when I type "google" and then press ctrl and enter, it crashes.. and i take lots of error reports. firefox 2 was better.. see you again , harun Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; tr; rv:1.9) Gecko/2008052906 Firefox/3.0 From URL: http://hendrix.mozilla.org/ ...

Build errors message but no errors in Error List
I am using VB.Net in Visual Web Developer Express. When I press F5 to run my application I get the 'There were build errors. Wouild you like to continue and run the last successful build?' message. I select 'No', and,  if the Error List window was shut it opens, but there are no errors listed in it. I'm sure this has worked before. Is there another way of finding errors? According to Help | About I am using version 8.0.50727.42. Thanks for any help.  One of the things with the error window is you can selectively display errors, warnings and messages.  I...

I Get this error : Compiler Error Message BC30002.
Hi everybody, i'm working on a project and works fine in my local server, but when i try to public into the production server, doesn't works i get this error: Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: BC30002: Type 'ClsDataAccess' is not defined.Source Error:  Line 3: Partial Class Presentacion_MasterPageLine 4: Inherits System.Web.UI.MasterPageLine 5...

[ILINK32 Error] Error: Unresolved external -- Error message
I have a VCL component compiled using Delphi 2010. This VCL component accesses functions in an external DLL. When I try to use this component in C++ Builder 2010, I get the error message below when compiling: [ILINK32 Error] Error: Unresolved external 'PdacOpenDatabase' referenced from C:\PROGRAM FILES (X86)\PERVASIVE SOFTWARE\PSQL\SDK\PDAC\DELPHI2010\LIB\PB200R2010.LIB|btvtables This only occurs when "Build with runtime packages" is unchecked and only within C++ Builder. If I compile the same basic program in Delphi, it works using runtime packages or not. Any id...

How to get error stack trace for showing error message
I am using http://www.asp.net/ajax/documentation/live/tutorials/CustomizingErrorHandlingforUpdatePanel.aspx for Using Client Script to Customize Error HandlingI am able to get the error message from errorMessage = args.get_error().message;But how can i get the stack trace of the error message ?  Kamran ShahidSr. Software Engineer(MCP,MCAD.net,MCSD.net,MCTS,MCPD.net[web])Netprosys Inc.www.netprosys.comRemember to click "Mark as Answer" on the post that helps U Any idea friends ?Kamran ShahidSr. Software Engineer(MCP,MCAD.net,MCSD.net,MCTS,MCPD.net[web])Netprosys Inc.www....

Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configure
Hello. I got this error on my brinkster hosting.   I have a virtual directory and on the virtual directory is a fodler called webroot. and on this there are 7 subdirectorys according to each one of my domains.  As the error says. I cant create a virtual directory because its not a dedicated server.     Server Error in '/' Application. Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. ...

Error error error, help me
Hello, How do I populate a drop down list in asp.net from a database? I have a block of vbscript code that does the server side coding for it. My code is as follows.. <script language="vb" runat="server"> Dim objConn As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\data\employee.mdb;") Dim Sql, valEmp As String Dim objDREmp as OleDbDataReader Sub FillEmployeeName(sender As Object, e As System.EventArgs) Sql = "select * from [Employee]" Dim objCommand As Ole...

superreview denied: [Bug 172051] Add localizable error messages for NSS error codes : [Attachment 142493] register NSS error strings with NSPR. Use those strings.
Wan-Teh Chang <wchang0222@aol.com> has denied Nelson Bolyard <MisterSSL@aol.com>'s request for superreview: Bug 172051: Add localizable error messages for NSS error codes http://bugzilla.mozilla.org/show_bug.cgi?id=172051 Attachment 142493: register NSS error strings with NSPR. Use those strings. http://bugzilla.mozilla.org/attachment.cgi?id=142493&action=edit ------- Additional Comments from Wan-Teh Chang <wchang0222@aol.com> I also think that the SEC and SSL error tables should be installed by NSS_Init() automatically. Since there is no NSPR function to...

Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configure
Dear All, I am a newbie and this is my first time trying to run asp.net :) I was trying to deploy the wrox asp.net sample code and this is what I got when I tried to run it. I created a virtual directory called "wrox". I have changed the username in the machine.config <processModel> to: userName="SYSTEM" password="AutoGenerate" I thought it was supposed to run because it is WROX OFFICIAL SAMPLE CODE. Server Error in '/wrox' Application. -------------------------------------------------------------------------------- Configur...

superreview requested: [Bug 172051] Add localizable error messages for NSS error codes : [Attachment 142493] register NSS error strings with NSPR. Use those strings.
Nelson Bolyard <MisterSSL@aol.com> has asked Wan-Teh Chang <wchang0222@aol.com> for superreview: Bug 172051: Add localizable error messages for NSS error codes http://bugzilla.mozilla.org/show_bug.cgi?id=172051 Attachment 142493: register NSS error strings with NSPR. Use those strings. http://bugzilla.mozilla.org/attachment.cgi?id=142493&action=edit ...

superreview granted: [Bug 430999] Console log error message: .sdef error: Operation could not be completed. (NSXMLParserErrorDomain error 27.) : [Attachment 317951] Use &quot; instead
Stuart Morgan <stuart.morgan@alumni.case.edu> has granted Smokey Ardisson (behind; no bugmail - do not email) <alqahira@ardisson.org>'s request for superreview: Bug 430999: Console log error message: .sdef error: Operation could not be completed. (NSXMLParserErrorDomain error 27.) https://bugzilla.mozilla.org/show_bug.cgi?id=430999 Attachment 317951: Use &quot; instead https://bugzilla.mozilla.org/attachment.cgi?id=317951&action=edit ------- Additional Comments from Stuart Morgan <stuart.morgan@alumni.case.edu> sr=smorgan ...

superreview requested: [Bug 430999] Console log error message: .sdef error: Operation could not be completed. (NSXMLParserErrorDomain error 27.) : [Attachment 317951] Use &quot; instead
Smokey Ardisson (behind; no bugmail - do not email) <alqahira@ardisson.org> has asked Stuart Morgan <stuart.morgan@alumni.case.edu> for superreview: Bug 430999: Console log error message: .sdef error: Operation could not be completed. (NSXMLParserErrorDomain error 27.) https://bugzilla.mozilla.org/show_bug.cgi?id=430999 Attachment 317951: Use &quot; instead https://bugzilla.mozilla.org/attachment.cgi?id=317951&action=edit ------- Additional Comments from Smokey Ardisson (behind; no bugmail - do not email) <alqahira@ardisson.org> Except they're not rea...

Web resources about - Getting error message using error number - sybase.sqlserver.nt

Costumes, Toys, And Soup Add Up: Star Wars Stuff May Be Worth More Than $9B To Disney
Hey, have you heard of this little movie coming out on Friday? It’s a Star Wars installment. Barely anyone is talking about it and there’s no ...

Trump Spox: Muslim Ban 'Not Religious Discrimination' Because Any Muslim Can 'Flip Into A Jihadist'
Katrina Pierson, a national spokeswoman for Donald Trump’s presidential campaign, addressed concerns about Trump’s proposal for a ban on Muslim ...


A Single Typo Nearly Killed the Paris Climate Accord
Hours before the historic Paris climate accord was to be ratified in a final vote, someone noticed that a word had been changed in the final ...

Sarah Palin's 'crush' on France NF deputy Marion Maréchal-Le Pen
Sarah Palin has confessed to having a "political crush" on far right French politician Marion Marechal-Le Pen, whom she likened to Joan of Arc. ...

Google Maps for iOS gets offline navigation, popular business hours, and up-to-date gas prices
Emil Protalinski / VentureBeat : Google Maps for iOS gets offline navigation, popular business hours, and up-to-date gas prices — Google today ...

Baltimore Police Gear Up as Closing Arguments Start in Freddie Gray Trial
The trial of the first police officer involved in the case is coming to an end.

At Pentagon, Obama leads strategy session about Islamic State terror
USA TODAY At Pentagon, Obama leads strategy session about Islamic State terror USA TODAY WASHINGTON — President Obama huddled with his top ...

Beware of state-sponsored hackers, Twitter warns dozens of users
Enlarge (credit: @coldhakca ) Twitter has warned dozens of users that their account data may have been targeted by state-sponsored hackers. ...

US sets drone registration rules, deadline
That drone under the Christmas tree? If you are a US resident, you will need to register it by February 19 or face a possible fine.

Resources last updated: 12/14/2015 5:58:20 PM