Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1062045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T18:33:52+00:00 2026-05-16T18:33:52+00:00

Why the error does not appear at the UI layer? I am using ExecuteScaler

  • 0

Why the error does not appear at the UI layer? I am using ExecuteScaler

BEGIN CATCH

  PRINT N'The transaction is in an uncommittable state. Rolling back transaction.'
  ROLLBACK TRANSACTION;

  DECLARE @ErrorMessage NVARCHAR(4000);
  DECLARE @ErrorSeverity INT;
  DECLARE @ErrorState INT;

  SELECT @ErrorMessage = ERROR_MESSAGE(),
         @ErrorSeverity = ERROR_SEVERITY(),
         @ErrorState = ERROR_STATE();

  RAISERROR (@ErrorMessage, 
             @ErrorSeverity,
             @ErrorState);

END CATCH

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T18:33:52+00:00Added an answer on May 16, 2026 at 6:33 pm

    You can only raise user messages, system messages can only be raised by the engine:

    Error numbers for user-defined error
    messages should be greater than 50000.
    When msg_id is not specified,
    RAISERROR raises an error message with
    an error number of 50000.

    Therefore you cannot raise the original @ErrorMessage, you have to raise a new error code.

    Also, your catch block is incorrect in as it assumes an uncommittable transaction. This is not always the case, you must check the result of XACT_STATE() before deciding if the transaction is doomed. There are many cases on which the error handling can continue the transaction. See Exception handling and nested transactions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

def FileCheck(fn): try: fn=open(TestFile.txt,U) except IOError: print Error: File does not appear to exist.
I'm receiving an error in my crystal report: The reminaing text does not appear
I keep having an error when running my web application. The error does not
I am getting the error: 'string[]' does not contain a definition for 'Cast' and
I get the following error: Client does not support authentication protocol requested by server;
I'm getting the error T does not contain a definition for Id below in
I am having an error: Error 2 'int[]' does not contain a definition for
the source is throwing the error: 'nn.asdf' does not contain a definition for 'extension_testmethod'
In the following I the get the error IndentationError: unindent does not match any
This works printf(%s body\n,__PRETTY_FUNCTION__); But this does not (Error Expected ')' ): printf(__PRETTY_FUNCTION__ body\n);

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.