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.

Answers were Sorted based on User's Feedback



How to handle errors in Stored Procedures. I want to display a message to the user in the .aspx pag..

Answer / bru medishetty

You can use RaiseError or use the TRY CATCH Programming in
the Stored Procedure Code.

Thanks,
Bru Medishetty
www.LearnSQLWithBru,com

Is This Answer Correct ?    2 Yes 0 No

How to handle errors in Stored Procedures. I want to display a message to the user in the .aspx pag..

Answer / 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

More SQL Server Interview Questions

Tell me what do we need queues in sql service broker?

0 Answers  


Can we use where and having clause together?

0 Answers  


What authentication modes does sql server support?

0 Answers  


What is a trigger and types of a trigger?

0 Answers  


What is use of @@ spid in sql server?

0 Answers  






What is Check point? Explain in Brief what it will do?

1 Answers   Wipro,


Give me any three differences between Truncate and Delete.

0 Answers   Genpact,


can anybody tell us, how to select 2nd max salary from table. my id is ashish.akk@gmail.com

28 Answers   IBM, Symphony,


What is data file in computer?

0 Answers  


Define tool Manage Statistics in SQL Server 2000 query ?

0 Answers   NA,


How to drop an existing user defined function in ms sql server?

0 Answers  


What are transactions in sql?

0 Answers  


Categories