i need to put fetch next in my cursor.its goig endless.
declare @P1 nvarchar(32)declare @mtd2 floatdeclare c1 CURSOR FOR select account, MTD from #temp2open c1FETCH NEXT FROM c1 INTO @P1,@mtd2WHILE @@FETCH_STATUS = 0beginif(@mtd2 IS NULL ) BEGINdeclare @IRR2 floatEXEC pdashboardselect @IRR2 = IRR from pdashboardSELECT @IRR2 as Last1monthENDELSE BEGINselect @mtd2 as last2month ENDfetch next from c1 into @P1,@MTD2ENDwhere do i need to put ?
Just out of curiosity, what is it you're trying to accomplish? Depending on what your needs are, might be easier implementation than cursor.
got solve .thanks