assigni to output var

  • hi,

    my proc is as follows:

    CREATE PROCEDURE NN

    @OPT varchar(max) OUTPUT

    AS

    DECLARE @NUM1 INT;

    DECLARE @NM VARCHAR(100)

    begin

    SET @NM='A';

    set @NUM1=1;

    WHILE @NUM1 < 10

    begin

    SET @NUM1 = @NUM1 + 1

    SET @OPT=@OPT+@NM

    end

    end

    i am expecting out put as AAAAAAAAAA

    but it IS NOT.

    pls help me on this

    bhushan

  • [font="Verdana"]

    Try

    Create PROCEDURE NN

    @OPT varchar(100) OUTPUT

    AS

    Select @OPT = replicate('A', 10)

    Go

    declare @OP varchar(15)

    exec NN @OPT = @OP output

    select @OP

    Mahesh

    [/font]

    MH-09-AM-8694

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

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