Hi Redgate Team,

The code
BEGIN CATCH
@TRANCOUNT > 0 AND XACT_STATE() <> 0
ROLLBACK TRAN;
THROW;
END CATCH;
GO

will be formatted like this:

BEGIN CATCH
@TRANCOUNT > 0
AND XACT_STATE() <> 0
########ROLLBACK TRAN;
####THROW;
END CATCH;
GO

But referring to my formatting style it should look like this:

BEGIN CATCH
@TRANCOUNT > 0 AND XACT_STATE() <> 0
########ROLLBACK TRAN;
####THROW;
END CATCH;
GO

Can you please fix the line break after AND or ensure it will be aligned with the IF statement - I guess it is a bug in the formatting algorithm.

Thanks!

Torsten
Friend of Redgate
torsten.strauss
0

Comments

1 comment

  • Tianjiao_Li
    Hi Torsten,

    Thanks for posting!

    Can you please share your formatting style file so that I can try to reproduce the issue? I failed to format your syntax sample using SQL format as it's an incorrect syntax. Do you have other samples I can try again?

    Kind regards,

    Tianjiao Li
    Product Support Engineer
    Tianjiao_Li
    0

Add comment

Please sign in to leave a comment.