• Derek (12/6/2008)


    Could it be possible in the FROM?

    No. Same problem as in the where. Join conditions must be conditions, not statements.

    Just trying to parse that query shows that it won't work.

    Msg 4145, Level 15, State 1, Line 2

    An expression of non-boolean type specified in a context where a condition is expected, near 'INNER'.

    The only way to include a condition that's stored as a string is to use dynamic SQL.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass