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

How many types of system privileges are there, Can we add or delete privileges?

2 Answers  


Explain throw statement in sql server 2008?

1 Answers  


What are the different types of backups that exist?

1 Answers   ADITI,


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

3 Answers  


Explain the various types of concurrency problem?

1 Answers  


How can we delete Duplicate row in table?

1 Answers   Wipro,


How do you simulate a deadlock for testing purposes

1 Answers  


What are Magic Table?

34 Answers   3i Infotech, Digiweb, Evalueserve, NIIT, PL,


Explain system scalar functions?

1 Answers  


What is a job?

3 Answers  


What are secondary xml indexes?

1 Answers  


what are batch in sql server?

2 Answers   Satyam,


Categories