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

  • Home
  • SEARCH
  • 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 3495248
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T12:06:14+00:00 2026-05-18T12:06:14+00:00

I am trying to isolate an issue (that resembles the topic in stackoverflow.com/q/483787/537284). The

  • 0

I am trying to isolate an issue (that resembles the topic in stackoverflow.com/q/483787/537284). The issue involves a stored procedure and occurs “randomly” once a week. To try and reproduce the issue, I created different procedure versions to mimic good and bad possible outcomes:

  • Good multi-row single resultset.
  • Good multi-row single resultset with informational message.
  • Good multi-row single resultset with Raiserror (less than level 11).
  • Good multi-row single resultset with Print.
  • Good empty single resultset.
  • Bad syntax error.
  • Bad syntax error with try/catch.
  • Bad error with Raiserror (level 11).
  • Bad error with Raiserror (level 11) and try/catch.

Between these tests, the syntax error with try/catch version behaved differently than what I would expect. Two resultsets (one empty and the other from the catch instruction) come back.

Does the syntax error get partially executed? I expected the catch block’s result and not the try. I compared this with a Raiserror and using severity 11, it triggers the catch block with only one resultset returned. What is the difference between the syntax error and the Raiserror?

Here is my test procedure:

AS
BEGIN
    SET NOCOUNT ON
    SET ANSI_WARNINGS ON    
    SET IMPLICIT_TRANSACTIONS OFF 
    SET XACT_ABORT OFF 
    SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED

BEGIN TRY
    --RAISERROR ('goes to message tab yes?', 11, 1) WITH NOWAIT
    SELECT '1' [myfield] FROM test_fulltext (nolock) WHERE CONTAINS(Command,'a monkey')
    RETURN 0
END TRY
BEGIN CATCH
    SELECT ERROR_NUMBER() [ErrorNumber]
END CATCH
RETURN -9999
END

Here is my test table (ripped from others):

CREATE TABLE test_fulltext 
( 
    SPID INT NOT NULL, 
    Status VARCHAR(32) NULL, 
    Login SYSNAME NULL, 
    HostName SYSNAME NULL, 
    BlkBy SYSNAME NULL, 
    DBName SYSNAME NULL, 
    Command VARCHAR(32) NULL, 
    CPUTime INT NULL, 
    DiskIO INT NULL, 
    LastBatch VARCHAR(14) NULL, 
    ProgramName VARCHAR(32) NULL, 
    SPID2 INT 
)
CREATE UNIQUE INDEX fulltextui ON test_fulltext(SPID);
CREATE FULLTEXT CATALOG fulltextft AS DEFAULT;
CREATE FULLTEXT INDEX ON test_fulltext(Command) KEY INDEX fulltextui;
  • 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-18T12:06:15+00:00Added an answer on May 18, 2026 at 12:06 pm

    Make sure to read the Remarks section fully on TRY…CATCH in Books Online. It explains this behavior in painful detail.

    What I don’t understand is this whole business about “forcing a syntax error”… If it’s in a stored procedure and you have a syntax error in it, the SP won’t even be created. Could it be that you’re actually executing an older version of the stored procedure?

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

Sidebar

Related Questions

I have simplified an issue that I've been having trying to isolate the problem,
Using Lambdaj, I am trying to isolate, from a list, an object that satisfies
XML trickiness. I'm trying to isolate the node with a sports Match that is
I am trying to isolate and add a class to a clicked anchor tag.
I'm trying to isolate array name and array size from code. This example of
I'm trying to isolate a specific field in a SQL dump file so I
I have been trying to find if i can easily isolate and test azure
I am trying to bind an image that is saved in isolated storage and
I've been trying to isolate a bug in my application. I succeeded in producing
I'm trying to isolate duplicates in a 500MB database and have tried two ways

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.