Search all columns of a table for a value?

后端 未结 9 1523
自闭症患者
自闭症患者 2021-01-17 15:36

I\'ve looked for an answer to this, but all I can find is people asking how to search all columns of ALL tables in a database for a value. I just want to search all columns

9条回答
  •  清酒与你
    2021-01-17 16:16

    I have no idea of the column types or data values you're searching for, but I'd guess you're trying to search for a substring among multiple text columns.

    This is a job for Full-Text Search.

    Don't waste time with LIKE '%' + @SearchStr + '%'. You have to write a lot of complicated code to support it, and that solution won't perform well anyway.

提交回复
热议问题