Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.
ALTER Proc [dbo].[sp_MobFilters] as BEGIN declare @counter int, @countfilter int, @Sql nvarchar(4000), @PositionId int, @SSN varchar(10), @cur cursor, @taskID int, @Qid int, @Posn_Data varchar(50), @Sold_Data varchar(50) Declare Filter_Cursor CURSOR FOR Select distinct mf.intQuestionId, q.strFilterSql From tblMobFilter mf INNER JOIN tblSRPQuestion q on q.intQuestionId = mf.intQuestionId OPEN Filter_Cursor FETCH NEXT FROM Filter_Cursor INTO @Qid,@Sql while @@FETCH_STATUS =0 BEGIN --- Call the SQL Filter and assign the unit # as the variable to get at table set @Sql = N'set @cur = cursor for ' + @Sql + ';open @cur'; exec sp_executesql @Sql, N'@cur cursor OUTPUT', @cur output; fetch next from @cur into @PositionId, @Posn_Data, @Sold_Data, @SSN; while @@FETCH_STATUS =0 BEGIN Insert Into tblPermTaskTemp (intQId, intPositionID, dtFound, strPosnData, strSoldData, strSSN) VALUES (@Qid, @PositionId, Getdate(), @Posn_data, @Sold_Data, @SSN); END fetch next from @cur into @PositionId, @Posn_Data, @Sold_Data, @SSN; END close @cur; deallocate @cur ; END FETCH NEXT FROM Filter_Cursor INTO @Qid,@Sql; Close Filter_Cursor deallocate Filter_Cursor
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.