Fwiw, I prefer the a different way to check the current ansi / connection settings, using:
I actually use a table of config values so the code is more readable, but here's the direct value comparison method:
IF @@OPTIONS & 16 > 0
PRINT 'ANSI_PADDING is ON'
PRINT 'ANSI_PADDING is OFF'
IF @@OPTIONS & 16384 > 0
PRINT 'XACT_ABORT is ON'
PRINT 'XACT_ABORT is OFF'
SQL DBA,SQL Server MVP(07, 08, 09)[size=2]Prosecutor James Blackburn, in closing argument in the Fatal Vision murders trial: If in the future, you should cry a tear, cry one for them [the murder victims]. If in the future, you should say a prayer, say one for them. And if in the future, you should light a candle, light one for them.[/size]