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 are the exceptions handled in sql server programming?

0 Answers  


How do I make a resultset scrollable?

0 Answers  


There is a trigger defined for INSERT operations on a table, in an OLTP system. The trigger is written to instantiate a COM object and pass the newly insterted rows to it for some custom processing. What do you think of this implementation? Can this be implemented better?

1 Answers  


how to find the second salary?

10 Answers   HCL, Prithvi,


How to change a login name in ms sql server?

0 Answers  






To find second largest salary in Employee table

17 Answers   CSS,


Tell me what are the essential components of sql server service broker?

0 Answers  


Is it possible to allow NULL values in foreign key? I s it possible to use different constraints for the same column in the table (i.e) (id int NOT NULL,UNIQUEUE)

1 Answers  


Can we use pragma autonomous_transaction in trigger?

0 Answers  


can you any body tell me the how to decrease the logfile

4 Answers  


What number aggregate functions are accessible there in sql?

0 Answers  


Difference b/w Clustered & non-clustered index? Not the bookish definition, but how they internally works in SQL Server?

1 Answers   United Healthcare,


Categories