Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2004

    Unhappy Unanswered: Procedure

    Everytime I execute this procedure it gives a msg 512 subquery returns more then one value. Can someone just explain why or what I'm doing wrong? Thanks in advance

    Here is my code:

    create procedure insert_sku_info
    @method varchar(40),
    @sku int,
    @location varchar(40)

    Declare insert_cur Cursor For
    select a.method, s.sku, s.location
    from archive_sku a INNER JOIN sku s on a.sku = s.sku
    and a.location = s.location

    Open insert_cur

    Fetch Next from insert_cur
    Into @method, @sku, @location

    While (@@Fetch_Status = 0)

    print @method + @sku + @location

    Update sku
    set method = @method
    where sku = @sku
    and location = @location

    Fetch Next from insert_cur
    Into @method, @sku, @location

    close insert_cur
    deallocate insert_cur
    Last edited by goreejm; 01-06-04 at 22:19.

  2. #2
    Join Date
    Jan 2004

    Re: Procedure

    Never mind I figured it out.

    That print statement I had listing all the variables was the problem.

    Thanks anyway.

Posting Permissions

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