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

OPTIMIZATION OF SP,CURSOR,TRIGGERS

0 Answers  


How do you debug a procedure in sql server?

0 Answers  


What are tasks?

3 Answers   Wipro,


What are the types of database recovery models?

0 Answers   HCL,


what is difference between having and where clause ?

3 Answers  






Can a stored procedure call itself or a recursive stored procedure? How many levels of sp nesting is possible?

0 Answers  


What do you understand by integration services in sql server?

0 Answers  


1.Describe way(s) to tune the SQL table in order to optimize performance. 2. Explain SQL Injection and how can you prevent them?

1 Answers   Techno Solutions,


What is the filtered index?

0 Answers  


What is the fillfactor concept in indexes?

0 Answers  


How do you send email on SQL Server?

0 Answers   MindCracker,


what are the joins,primary key,foriegn key, candidate key, super key and expain them?

6 Answers   Polaris,


Categories