2010-08-24 77 views
14

我在调试一个似乎与ARITHABORT有关的奇怪行为。我如何检索当前的ARITHABORT值作为活动连接?检索ARITHABORT的当前值

欢呼声, 阿希姆

回答

23
select SESSIONPROPERTY('ARITHABORT') 

returns 1 or 0,取决于它是否是开启或关闭

+1

+1这肯定会在KISS部门获胜。 – 2010-08-24 07:05:47

4

@@OPTIONS使您可以获取正在为当前会话设置电流值的一个位域。
位字段可以用以下脚本解释。

DECLARE @options INT 
SELECT @options = @@OPTIONS 

PRINT @options 
IF ((1 & @options) = 1) PRINT 'DISABLE_DEF_CNST_CHK' 
IF ((2 & @options) = 2) PRINT 'IMPLICIT_TRANSACTIONS' 
IF ((4 & @options) = 4) PRINT 'CURSOR_CLOSE_ON_COMMIT' 
IF ((8 & @options) = 8) PRINT 'ANSI_WARNINGS' 
IF ((16 & @options) = 16) PRINT 'ANSI_PADDING' 
IF ((32 & @options) = 32) PRINT 'ANSI_NULLS' 
IF ((64 & @options) = 64) PRINT 'ARITHABORT' 
IF ((128 & @options) = 128) PRINT 'ARITHIGNORE' 
IF ((256 & @options) = 256) PRINT 'QUOTED_IDENTIFIER' 
IF ((512 & @options) = 512) PRINT 'NOCOUNT' 
IF ((1024 & @options) = 1024) PRINT 'ANSI_NULL_DFLT_ON' 
IF ((2048 & @options) = 2048) PRINT 'ANSI_NULL_DFLT_OFF' 
IF ((4096 & @options) = 4096) PRINT 'CONCAT_NULL_YIELDS_NULL' 
IF ((8192 & @options) = 8192) PRINT 'NUMERIC_ROUNDABORT' 
IF ((16384 & @options) = 16384) PRINT 'XACT_ABORT'