Forum Replies Created

Viewing 15 posts - 511 through 525 (of 1,048 total)

  • RE: Isolation Level

    Hi Chris,

    I have put some transaction statement in this script.

    Is this right?

    --ALTER Procedure [dbo].[BS_Voucher_CreateVoucher]

    Declare@vouchertypeID int = 1,

    @denomination int = 400,

    @quantity int = 5,

    @amountvalue int = 100,

    @userid varchar(50) = 1,

    @validateDays...

  • RE: Isolation Level

    ChrisM@Work (5/8/2013)


    Here's an excellent article to help you out:

    http://www.sqlservercentral.com/articles/T-SQL/62867/%5B/url%5D

    Ok thanks a lot.. 🙂

    will go through this article after completing transaction work with this script...

    plz help me on this

  • RE: Isolation Level

    ChrisM@Work (5/8/2013)


    kapil_kk (5/8/2013)


    ...

    Yess it worked now 🙂

    Thanks a lot..

    can we move fwd now towards error handling and transaction

    Sure. This bit first?

    kapil_kk (5/8/2013)


    Also, I am not clear what this will do...

  • RE: Isolation Level

    kapil_kk (5/8/2013)


    Also, I am not clear what this will do please explain.. I also want to learn error handling and transaction for this script:

    WITH E1(N) AS (

    SELECT 1 UNION ALL...

  • RE: Isolation Level

    ChrisM@Work (5/8/2013)


    Yes that's correct.

    Here's an updated script which is adjusted to account for NULL values of VoucherValue:

    --ALTER Procedure [dbo].[BS_Voucher_CreateVoucher]

    DECLARE

    @vouchertypeID int = 1,

    @denomination int = 100,

    @quantity int = 10,

    @amountvalue int...

  • RE: Isolation Level

    ChrisM@Work (5/8/2013)


    kapil_kk (5/8/2013)


    ChrisM@Work (5/8/2013)


    The last SELECT in that script is

    SELECT VoucherNumber = @VoucherNumber, retval = @retval

    What values are returned?

    VoucherNumberretval

    0VB

    Thanks.

    Either the table gv_vouchervalue doesn't have a row where voucherabbreviation =...

  • RE: Isolation Level

    ChrisM@Work (5/8/2013)


    The last SELECT in that script is

    SELECT VoucherNumber = @VoucherNumber, retval = @retval

    What values are returned?

    VoucherNumberretval

    0VB

  • RE: Isolation Level

    Also, I am not clear what this will do please explain.. I also want to learn error handling and transaction for this script:

    WITH E1(N) AS (

    SELECT 1 UNION ALL SELECT...

  • RE: Isolation Level

    ChrisM@Work (5/8/2013)


    Debugging a script like this is quite tricky without any data to test against. Try running this:

    --ALTER Procedure [dbo].[BS_Voucher_CreateVoucher]

    DECLARE

    @vouchertypeID int = 1,

    @denomination int = 100,

    @quantity int = 10,

    @amountvalue...

  • RE: conversion of the varchar value overflowed an int column

    ChrisM@Work (5/7/2013)


    kapil_kk (5/7/2013)


    ChrisM@Work (5/7/2013)


    I'm sure there's an easier (and safer) way of doing this.

    ALTER PROCEDURE [dbo].[BS_GetSTNValue]

    --DECLARE

    @pFromStore int = 1001,

    @pToStore int = 1004,

    @pSTN VARCHAR(20) = 0 output

    AS

    --BEGIN

    DECLARE

    @count INT...

  • RE: Isolation Level

    ChrisM@Work (5/7/2013)


    Thanks. Try this. With multiple dml statements it still requires a transaction and error handling:

    ALTER Procedure [dbo].[BS_Voucher_CreateVoucher]

    @vouchertypeID int = 1,

    @denomination int = 100,

    @quantity int = 10,

    @amountvalue int = 100,

    @userid...

  • RE: Isolation Level

    ChrisM@Work (5/7/2013)


    Yes you're right:

    ALTER Procedure [dbo].[BS_Voucher_CreateVoucher]

    @vouchertypeID int = 1,

    @denomination int = 100,

    @quantity int = 10,

    @amountvalue int = 100,

    @userid varchar(50) = 1,

    @validateDays int = 40

    AS

    --BEGIN

    SET NOCOUNT ON;

    DECLARE

    @vouchertype varchar(20),

    @transactionID varchar(20),

    @count int =1,

    @VoucherNumber...

  • RE: Isolation Level

    The only issue I have in my script is how to handle transaction in this script.....

    ALTER Procedure [dbo].[BS_Voucher_CreateVoucher]

    @vouchertypeID int = 1,

    @denomination int = 100,

    @quantity int = 10,

    @amountvalue int...

  • RE: Isolation Level

    ChrisM@Work (5/7/2013)


    Which column of the VALUES clause of the INSERT statement is it?

    'V'+@retval + Replace( Str( @max-2 + @count, 7), ' ', '0') ?

    seems likely, but you have no...

  • RE: conversion of the varchar value overflowed an int column

    ChrisM@Work (5/7/2013)


    I'm sure there's an easier (and safer) way of doing this.

    ALTER PROCEDURE [dbo].[BS_GetSTNValue]

    --DECLARE

    @pFromStore int = 1001,

    @pToStore int = 1004,

    @pSTN VARCHAR(20) = 0 output

    AS

    --BEGIN

    DECLARE

    @count INT = 0,

    @AWBNo...

Viewing 15 posts - 511 through 525 (of 1,048 total)