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
What is garbage collection? Explain the difference between garbage collections in .net 4.0 and earlier versions?
What are multicast delegates?
What is the difference between .net and laravel?
What is Full trust permission set in .Net
What is the intermediate language between asp and asp.net1.0?
Difference between value type & reference types ?
What is the root class in .net?
What method do you use to explicitly kill a users session? How?
What is the difference between .net 2000 and .net 2005(features)? Which one is better?
How do we access crystal reports in .net?
What is dot net and its uses?
What is the base class of Button control in .NET?
Explain the difference between static page and dynamic page?
Is .net core the future?
Explain what is the difference between encrypting a password and applying a hashing?