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

Define a cross join?

0 Answers  


Do you know spatial data types - geometry and geography in sql server 2008?

0 Answers  


What is a mutating table error and how can you get around it?

0 Answers  


How do we know if any query is retrieving a large amount of data or very little data?

0 Answers  


What is database replicaion? What are the different types of replication you can set up in SQL Server?

5 Answers   Aptech, HCL, Perpetual, SAIC,






How to define output parameters in stored procedures?

0 Answers  


1. Tell me your daily activities 2. If sql server installation fails at time installation what will do 3. Where does the sql server installation log details are stored 4. After the installation what will you do for memory configuration 5. What is the difference between SQL max maximum memory and AWE memory 6. How will you configure AWE memory 7. How will setup an email alert for the backup job 8. After the SQL installation what are the jobs will you configure 9. What does –g mean in the sql startup parameter 10. What is the difference between Bulked log and Full recovery model 11. What is the difference between mirroring and log shipping 12. What are the steps to be followed before in-place up gradation 13. After installing the patch the sql server does not start and application team tells to rollback the changes .In this scenario what will you do

0 Answers   CSC, IBM,


Can you explain what are various ways to enhance the ssrs report?

0 Answers  


What are the disadvantages of using querystrings to send data from one page to another?

0 Answers  


What is the meaning of resultset type_scroll_insensitive?

0 Answers  


What is tabulation?

0 Answers  


What is the difference between count () and rowcount ()?

0 Answers  


Categories