How to handle errors in Stored Procedures. I want to display
a message to the user in the .aspx page that is calling a
stored procedure in it's code behind. please help me.

Answer Posted / veeresh kethari

With simple example:

begin try
declare @int int
set @int='select 1/0'
end try
begin catch
print 'Error detected with error number -'+convert(char
(10),@@error)
end catch

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is sql collation?

828


What is the difference between SQL notification and SQL invalidation?

785


What are a database and a data warehouse?

739


How do I debug a stored procedure in sql server?

726


what is the information that can be stored inside a bit column? : Sql server database administration

706






How do I uninstall sql server 2014?

679


What do you know about normalization and de- normalization?

637


What is blocking?

718


What do we have to check in database testing?

766


What is DCL?

762


What is the use of tempdb? What values does it hold?

744


Would you store your query in a ssrs report or a database server? State the reason why?

132


What is auditing in sql server?

688


Explain how dts is used to extract, transform and consolidate data?

764


List out the differences between global and local temp tables in sql server?

749