Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Location
    Malaysia
    Posts
    17

    Post Unanswered: Stored Procedure

    CREATE procedure PRODUCTS_Update
    @ProductCode varchar(10),
    @ProductGroup varchar(50),
    @CoCode varchar(10),
    @Name varchar(100),
    @Category varchar(1),
    @ProductImage image,
    @Brand varchar(50),
    @CurrentPrice numeric(9),
    @Specifications varchar(100),
    @InStock numeric(9),
    @TotalOrdered numeric(9),
    @ExpectedDate datetime,
    @InDemand numeric(9),
    @ProductManager varchar(10),
    @Discount numeric(5),
    @NewArrival tinyint,
    @LaunchDate datetime,
    @CreateBy nvarchar(20),
    @CreateDate datetime,
    @ModifyBy nvarchar(20),
    @ModifyDate datetime
    as
    Declare @Rows int,
    @ErrNo Int,
    @ErrMsg varchar(255)
    Set Nocount off
    Begin Transaction
    Update PRODUCTS set ProductCode=@ProductCode,ProductGroup=@ProductGrou p,CoCode=@CoCode,Name=@Name,Category=@Category,Pro ductImage=@ProductImage,Brand=@Brand,CurrentPrice= @CurrentPrice,Specifications=@Specifications,InSto ck=@InStock,TotalOrdered=@TotalOrdered,ExpectedDat e=@ExpectedDate,InDemand=@InDemand,ProductManager= @ProductManager,Discount=@Discount,NewArrival=@New Arrival,LaunchDate=@LaunchDate,CreateBy=@CreateBy, CreateDate=@CreateDate,ModifyBy=@ModifyBy,ModifyDa te=CURRENT_TIMESTAMP where ProductCode=@ProductCode AND CoCode = @CoCode
    Select @ErrNo = @@error,@rows =@@rowcount
    If @Rows = 0
    Begin
    Select @ErrNo = 50001,@ErrMsg ='No Records Updated'
    Raiserror @ErrNo @ErrMsg
    GoTo ErrorHandler
    End
    If @ErrNo = 0
    Begin
    Commit Transaction
    Set Nocount on
    Return 0
    End
    Else
    Begin
    GoTo ErrorHandler
    End
    ErrorHandler:
    Rollback Transaction
    Set Nocount on
    Return @ErrNo

    GO


    pls tell me what is the problem...
    --------------------
    P.L.N.Prasad varma

  2. #2
    Join Date
    Jan 2003
    Location
    India
    Posts
    523

    Re: Stored Procedure

    what is the error msg that u get?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •