Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

Is there a simple way to query every column of a table

$
0
0

I'm using SQL Server Express 2012. I had a couple of questions:

1. I would like to know if there is a simple way to query every column in a table. By simple, I mean some sort of shorthand that indicates that the query should apply to every column without going through laborious task of adding each individual column to the where statement, i.e. WHERE (Column1 LIKE '%X%') OR (Column2 LIKE '%X%') OR ..., etc, etc. Instead, the query would simple state something like WHERE (Tablename.* LIKE '%X%'). It would search the entire table for whatever string without having to specify each column.

2. Just out of curiosity, assuming that there is a good answer to question #1, can this be scaled up to search all the tables within a given database?


Viewing all articles
Browse latest Browse all 7129

Trending Articles