1 Reply Latest reply: Mar 14, 2013 5:02 AM by Bastien Rogowski RSS

    Error in incremental

    Siraj Ahamed Saffiulla

      hi

       

      I have wrote Store Procedure like this

       

       

      CREATE PROCEDURE SP1_sample

      as

      Declare @i as Int;

      Declare @j as Int;

      declare @C as Int;

       

      create table #tab1temp(firstclum Numeric(20,2),secondcolum Numeric(20,2));

      begin

      select i=0;

      select j=10;

      select C=0;

                while (@i<=@j)

       

                begin

       

       

                          insert into #tab1temp values(@i,(@j-1));

                          select @i += 1;

                end

       

                select * from #tab1temp;

      end

         

      execute SP1_sample;

       

      in this code value is inserting in Temp table #tab1temp but value is not incrementing 'select @i += 1;' in this part of code

       

      can anyone help me how to increment  variable and how to insert into Temp Table...