Home Forums SQL Server 7,2000 T-SQL Use Table Column Contents As Where Clause RE: Use Table Column Contents As Where Clause

  • The only way to do that is to use dynamic SQL, build up the final query and then use sp_executeSQL to run it.

    Be aware of the downsides of dynamic SQL and watch for SQL injection.

    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