0

I am looking for something like this pseudo-code in SQL Server to search all columns for specific values in a single table:

SELECT * 
FROM Employee
WHERE any-column = 'HelloWorld'
   OR any-column = 1024

Can this be achieved in one statement or do you have to make a stored procedure to make this possible?

Shadi Alnamrouti
  • 11,796
  • 4
  • 56
  • 54
  • Thanks @BrianPressler for your support. I am strugling to find some answers because of the (sometimes) illogical duplicate catching practice adopted by stack overflow. I don't want to search all the DB. Practically, searching one table will be more useful and more efficient for many users, I hope they reopen the question, otherwise I am going to find answers somewhere else. – Shadi Alnamrouti May 14 '15 at 20:34
  • 1
    I found a genuine duplicate that does ask your question here: http://stackoverflow.com/questions/27918807/sql-search-all-columns-of-a-table-for-text-value/30249132#30249132. I posted my answer there. – Brian Pressler May 14 '15 at 23:29

0 Answers0