Explicit Transactions

  • Lynn Pettis

    SSC Guru

    Points: 442180

    Solomon Rutzky - Friday, July 13, 2018 1:09 PM

    Lynn Pettis - Friday, July 13, 2018 12:57 PM

    Solomon Rutzky - Friday, July 13, 2018 12:23 PM

    Please also note that transaction names are treated as having a binary Collation (not case-sensitive as the documentation currently states), regardless of the Instance-level or Database-level Collations.

    For details, please see the Transaction Names section of the following post: What’s in a Name?: Inside the Wacky World of T-SQL Identifiers

    Take care,
    Solomon...

    I thought that binary collations were case-sensitive?  Decided to check for myself and was surprised.

    It is a very common misconception that binary comparisons are case-sensitive (or anything sensitive, such as accent-sensitive, or width sensitive, etc), which is why I was clarifying there. Regarding the "checking", were you referring to this post:

    No, Binary Collations are not Case-Sensitive
    Take care,
    Solomon...

    Had not seen that.  I was just going on what you said earlier.

  • BrainDonor

    SSCoach

    Points: 19209

    Solomon Rutzky - Friday, July 13, 2018 12:23 PM

    The name can be in excess of 32 characters, but only the first 32 characters are actually used.

    Hi Steve. Regarding the statement from the article quoted above (pertaining to transaction name length), please note that the silent truncation you are referring to only applies to using a variable for the transaction name. If you are using a literal / constant for the transaction name, then you will get an error if you attempt to use more than 32 characters.

    Please also note that transaction names are treated as having a binary Collation (not case-sensitive as the documentation currently states), regardless of the Instance-level or Database-level Collations.

    For details, please see the Transaction Names section of the following post: What’s in a Name?: Inside the Wacky World of T-SQL Identifiers

    Take care,
    Solomon...

    I wasn't aware of that, thanks for the information.

    Steve.

    Steve Hall
    Linkedin
    Blog Site

  • sTTu

    SSC Veteran

    Points: 201

    Solomon Rutzky - Friday, July 13, 2018 9:45 AM

    sTTu - Monday, January 4, 2016 4:17 AM

    Interesting stuff and a few things I wasn't aware of.Would have liked to see errors and xact_abort covered also as this has caught me out in the past.

    Hi there. I posted an answer to DBA.StackExchange a few years ago on this topic and did include error handling, XACT_ABORT, XACT_STATE(), etc:

    How to rollback when 3 stored procedures are started from one stored procedure

    I hadn't seen that but very glad you pointed it out, what an excellent response - an article in itself!

Viewing 3 posts - 16 through 18 (of 18 total)

You must be logged in to reply to this topic. Login to reply