T-SQL: Dynamic Where clause in normal SQL statement
- by Torben H.
Hey there,
I looking for a way to dynamicly add a filter to my statment without using dynamic SQL.
I want to select all computers from a table, but when I pass a computer id to the sp, I want to get only this computer.
Actually I try this on
DECLARE @ComputerFilter AS INT
DECLARE @ComputerID AS INT
SELECT Computername
FROM Computer
WHERE …