where i should put set trasaction isolation level read uncommited/ snapshot

  • hi,

    stmt 1)

    CREATE PROCEDURE xyz1

    AS

    BEGIN

    -- SET NOCOUNT ON added to prevent extra result sets from

    -- interfering with SELECT statements.

    SET NOCOUNT ON;

    SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED

    declare @a int

    declare @b-2 int

    begin try

    BEGIN TRAN

    select 1

    commit tran ;

    end try

    begin catch

    rollback tran;

    end catch

    END

    stmt 2)

    CREATE PROCEDURE xyz1

    AS

    BEGIN

    -- SET NOCOUNT ON added to prevent extra result sets from

    -- interfering with SELECT statements.

    SET NOCOUNT ON;

    declare @a int

    declare @b-2 int

    SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED

    begin try

    BEGIN TRAN

    select 1

    commit tran ;

    end try

    begin catch

    rollback tran;

    end catch

    END

    stmt 3)

    CREATE PROCEDURE xyz1

    AS

    BEGIN

    SET NOCOUNT ON;

    declare @a int

    declare @b-2 int

    begin try

    SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED

    BEGIN TRAN

    select 1

    commit tran ;

    end try

    begin catch

    rollback tran;

    end catch

    END

    Q1) in stmt1 this stmt

    "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED"

    is

    one top with SET NOCOUNT ON;.

    in stmt2 this stmt

    "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED"

    is above begin try

    and in stmt 3 this stmt

    "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED"

    is below begin try and with begin tran.

    which one is should follow.

    yours sincerely.

  • My first reaction is don't put it anywhere, unless you're comfortable with the possibility of incorrect data. If you are, I'd go for Statement 1, where it's nice and neat next to the other SET statement.

    John

Viewing 2 posts - 1 through 1 (of 1 total)

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