2011-03-21 20 views
5

मैं एसएसएमएस में एक नई विंडो खोलता हूं और इसे चलाता हूं:त्रुटि: असामान्य लेनदेन हैं

SET ANSI_DEFAULTS ON 
GO 

CREATE PROCEDURE [dbo].[zzz_test2] 
(
    @a int 
) 
AS 
    SET NOCOUNT ON 
    SET @a=1 
    RETURN 0 
GO 

और फिर विंडो को बंद करें, जिसके परिणामस्वरूप यह चेतावनी होती है:

There are uncommitted transactions. Do you wish to commit these before closing the window?

क्या चल रहा है ??

जब मैं एक नई एसएसएमएस विंडो खोलता हूं और इसे चलाता हूं:

SET ANSI_NULLS ON 
GO  

CREATE PROCEDURE [dbo].[zzz_test2] 
(
    @a int 
) 
AS 
    SET NOCOUNT ON 
    SET @a=1 
    RETURN 0 
GO 

और विंडो बंद करें, मुझे कोई चेतावनी नहीं मिलती है।

उत्तर

8

described in the documentation रूप ANSI_DEFAULTS के लिए

When enabled (ON), this option enables the following ISO settings:

SET ANSI_NULLS 
SET CURSOR_CLOSE_ON_COMMIT 
SET ANSI_NULL_DFLT_ON 
SET IMPLICIT_TRANSACTIONS 
SET ANSI_PADDING 
SET QUOTED_IDENTIFIER 
SET ANSI_WARNINGS 

प्रलेखित here के रूप में जब IMPLICIT_TRANSACTIONS पर है।

Transactions that are automatically opened as the result of this setting being ON must be explicitly committed or rolled back by the user at the end of the transaction

+0

यह मुझे पागल कर रहा था !!!! खैर दुह! आप इसे इतना आसान बनाते हैं! – RacerX

संबंधित मुद्दे