What is the raise event used for?

Answer Posted / vini778

It is used for raising the error from sql statement
Eg shown below

IF @@TRANCOUNT>0 ROLLBACK TRANSACTION
Raise an error with the details of the
exception
DECLARE @ErrorMessage NVARCHAR
(
MAX
)
DECLARE @ErrorSeverity INT;
DECLARE
@ErrorState INT;
SELECT
@ErrorMessage=ERROR_MESSAGE
(
)
,
@ErrorSeverity=ERROR_SEVERITY
(
)
,
@ErrorState=ERROR_STATE
(
)
;
-- Use RAISERROR inside the CATCH
block to return error
-- information about the original
error that caused
-- execution to jump to the CATCH
block.
RAISERROR
(
@ErrorMessage,-- Message
text.
@ErrorSeverity,--
Severity.
@ErrorState -- State.
)
;

Is This Answer Correct ?    1 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between vb.net and vc#.net?

549


How do we access crystal reports in .net?

594


Can you explain what do you understand about web service?

611


Explain what is mutex?

592


What is your observations between vb.net and vc#.net?

543






Why you want to leave your previous company.

1593


Why SOAP is required?

672


What is close method? How its different from finalize and dispose?

529


Differences between datagrid, datalist and repeater in .net?

537


What is file extension of Webservices in .Net?

578


Usually in .net, the clr takes care of memory management. Is there any need for a programmer to explicitly release memory and resources? If yes, why and how?

569


Explain difference between panel and groupbox classes using .net?

544


How boxing and unboxing occures in memory?

614


What are multicast delegates?

585


What is different between webusercontrol and in webcustomcontrol?

542