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
Explain the purpose of Remoting in .NET?
One user deleted one row after that another user through his dataset was trying to update same row. What will happen? How will you avoid this problem?
What are the advantages of .net core?
What are the difference bbetween value type & reference types ? Example from .net. Integer & struct are value types or reference types in .net?
How to load a user control dynamically in runtime?
What is view state in .net?
What’s different between process and application in .net?
What is "common language runtime" (clr) in .net?
How is a managed code executed?
What are the improvements made in cas in .net 4.0?
What is new in .net core?
What is connection pooling and how do you make your application use it?
What is managed code and managed data in .net?
What is the difference between web application and enterprise application?
How will you load dynamic assembly? How will create assemblies at run time?