Forum Replies Created

Viewing post 1 (of 1 total)

  • RE: Creating a dynamic UNION query in a sp based on n records

    What about something like this:

    declare @thisPortfolio char(1),

     @DeskNum int

    declare portfolio_cursor cursor

     for select distinct portfolio from portfolios where DeskNum = @DeskNum

    open portfolio_cursor

    fetch next from portfolio_cursor into @thisPortfolio

    while @@FETCH_STATUS = 0

    begin

     select top 10 *

      into #report10

      from...

Viewing post 1 (of 1 total)