Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Syntax error not captured by @@ERROR

Author  Topic 

mr_blore
Starting Member

7 Posts

Posted - 2004-11-05 : 07:18:48
Hi..
I am not able to capture a syntax error in @@ERROR variable.
Errors like 'Syntax error converting the varchar value to a column of data type int'

I assume that its not the job of @@ERROR....But i need to know a way to handle such errors in the Stored procs.
My SP would have some "out" paramters. but if an syntax error like the above occurs, then my SP fails and so
the "out" param is not populated.

Any suggestions!!!

Thanks
Meera

"If you think you can, it means you can think!"

Kristen
Test

22859 Posts

Posted - 2004-11-05 : 08:00:54
Sometimes you can trap these type of errors if you EXEC some dynamic code, or put them in a child SProc and check @@ERROR after the EXEC/Child Proc returns

Kristen
Go to Top of Page
   

- Advertisement -