Sunday, July 22, 2007

Summer SQL Teaser #9 @@TRANCOUNT

Here is another quick teaser. What will be the values of the print statements? Try to guess it before running this code


SET ANSI_DEFAULTS ON

PRINT '#1 == ' + LTRIM(STR(@@TRANCOUNT))

BEGIN TRANSACTION

PRINT '#2 == ' + LTRIM(STR(@@TRANCOUNT))

ROLLBACK





No comments: