|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Error Handling not workinh after select a bad tableI have a SP that is executing a simple task, and I´m forcing an error, but the SQL Server is not catching the error, please help me. The code is: insert into table1 select * from table2_bad print @@error Notes: The table2_bad is not valid in the database, so the sql show an error saying that the table isnt create of something... but the variable @@error isnt filled. Do you know why?? Thanks! non trapable error, read this
http://www.sommarskog.se/error-handling-I.html and http://www.sommarskog.se/error-handling-II.html Denis the SQL Menace http://sqlservercode.blogspot.com/ sev***@gmail.com wrote: Show quote > Hi guys, > > I have a SP that is executing a simple task, and I´m forcing an error, > but the SQL Server is not catching the error, please help me. > > The code is: > > insert into table1 > select * from table2_bad > > print @@error > > > Notes: > The table2_bad is not valid in the database, so the sql show an error > saying that the table isnt create of something... but the variable > @@error isnt filled. > Do you know why?? > > Thanks! @@error would indicate a run time error. Because the code does not
compile, it does not execute. So, there is any way to catch the compilation error?
I read the documents above, but i cant found any information on that. Tks in advice. Execute the code in a test environment and verify the results -or lack
thereof. -- Show quoteArnie Rowland* "To be successful, your heart must accompany your knowledge." <sev***@gmail.com> wrote in message news:1152798776.654814.181530@h48g2000cwc.googlegroups.com... > So, there is any way to catch the compilation error? > > I read the documents above, but i cant found any information on that. > > Tks in advice. > |
|||||||||||||||||||||||