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

What is ms sql server triggers?

0 Answers  


How sql server enhances scalability of the database system?

0 Answers  


Difference between Function and Stored Procedure?

9 Answers   C1 India, NA,


What is Extended user-defined?

0 Answers  


What is the diff between Static Queries and Dynamic queries give me some examples

2 Answers   CSC,






If the job running very slow what is the action you do

0 Answers  


How many clustered indexes there can be on table ?

0 Answers  


What are scalar functions?

0 Answers  


What is a covering index?

0 Answers  


what is difference between nchar and char in Sql server ?

3 Answers  


What will be query used to get the list of triggers in a database?

0 Answers  


Every night you run a full backup after every 3 three hours you make a differential backup every hour you make an incremental backup in a worst-case scenario, how much work you can lose?

0 Answers  


Categories