Constructing T-SQL WHERE condition at runtime
- by Nickson
I would like to implement a search function where a user passes all the arguments to the "WHERE" clause at runtime. For example in query below,
SELECT Col1, Col2, Col3, Col4
FROM MyTable
WHERE Col2 = John
1.Now what i want is to give the user a dropdownlist of columnns such that the user selects
a column to search by at runtime
Also…