When you use @@error and try-catch?



When you use @@error and try-catch?..

Answer / Ashish Gangwar

@@ERROR is a system function in SQL Server that returns the last error number encountered during execution. The TRY-CATCH block is used for error handling within Transact-SQL code.nYou can use @@ERROR inside a TRY-CATCH block to catch and handle specific errors.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL Server Interview Questions

Can we have more than one NULL in a column having unique constraint?

12 Answers   247Customer,


How global temporary tables are represented and its scope?

1 Answers  


List the types of recovery model available in sql server?

1 Answers  


What is a sub-query? When would you use one?

3 Answers  


Does index slows down insert statements?

1 Answers  


What are the different types of joins and what does each do?

2 Answers  


what is cursor?why we will go to cursor?advantages &disadvantages of cursors?

1 Answers  


How can you list all the columns in a database?

1 Answers  


What is the use of builtinadministrators group in sql server? : sql server security

1 Answers  


How and why use sql server?

1 Answers  


Can we insert data into a view?

1 Answers  


What does it mean if @@cursor_row returns a negative number?

1 Answers  


Categories