• -- disclaimer: wild guess, I've run nothing! posting just for fun!

    Well I'm making the assumption that a player thats a rb can be rb1, rb2, or rb3, and there is no profit in putting him in as rb1 instead of rb3, you've said as much because you're sorting to eliminate those dupes. I'm also assuming that a rb is no use as a wr, or flx, or whatever, otherwise, you'll have to include the additional positions in the combination logic (as opposed to permutations).

    Its possible that what you want is combinations for the rb's and wr's, and cross joins for everything else, and maybe you can just ditch the key all together.

    WITH rb1 as SELECT (rb rb1, rb_sal rb1_sal, rb_score rb1_score from rb),

    rb2 as SELECT (rb rb2, rb_sal rb2_sal, rb_score rb2_score from rb),

    wr1 as SELECT (wr wr1, wr_sal wr1_sal, wr_score wr1_score from wr),

    wr2 as SELECT (wr wr2, wr_sal wr2_sal, wr_score wr2_score from wr),

    wr3 as SELECT (wr wr3, wr_sal wr3_sal, wr_score wr3_score from wr)

    INSERT INTO lineups ( qb, rb1, rb2, wr1, wr2, wr3, te, flx, d, LineupSal, LineupScore, LineupKey )

    SELECT qb.qb, rb1.rb rb1, rb2.rb rb2, wr1.wr wr1, wr2.wr wr2, wr3.wr wr3, te.te, flx.flx, d.d,

    [qb_sal]+[rb1_sal]+[rb2_sal]+[wr1_sal]+[wr2_sal]+[wr3_sal]+[te_sal]+[flx_sal]+[d_sal] AS LineupSal,

    [qb_score]+[rb1_score]+[rb2_score]+[wr1_score]+[wr2_score]+[wr3_score]+[te_score]+[flx_score]+[d_score] AS LineupScore

    FROM qb cross join rb1 cross join rb2 cross join te cross join flx cross join wr1 cross join wr2 cross join wr3 cross join d

    WHERE rb1 < rb2 and wr1 < wr2 and wr2 < wr3

    AND [qb_sal]+[rb1_sal]+[rb2_sal]+[wr1_sal]+[wr2_sal]+[wr3_sal]+[te_sal]+[flx_sal]+[d_sal] < @target_sal

    AND [qb_score]+[rb1_score]+[rb2_score]+[wr1_score]+[wr2_score]+[wr3_score]+[te_score]+[flx_score]+[d_score] > @target_score

    Permutation is when order matters, combination is when it doesn't.

    http://stackoverflow.com/questions/4159595/how-to-generate-a-permutations-or-combinations-of-n-rows-in-m-columns

    edit: fix possible syntax, remove qualifier from adjective "wild", and everything else might not be actual permutations.

    also forgot to mention, this uses one table for rb's and one table for wr's.