My question is basic.
I am creating a stored procedure and have it the following variable:
@ConcatenarClausulaWhere
During the execution of the procedure, several conditions are concatenated in this variable to be inserted after the WHERE:
SELECT ID
FROM TABLE1
WHERE indStatus = 'True'
AND (Description LIKE '%' + @ STRING + '%')
My intention was to do something like:
SELECT ID
FROM TABLE1 The
WHERE indStatus = 'True'
AND (Description LIKE '%' + @ STRING + '%') + @ ConcatenarClausulaWhere
But, it is not possible. Why?
I am using SQL Server 2008