Drawbacks of Dynamic Query in Sqlserver 2005 ?
- by KuldipMCA
I have using the many dynamic Query in my database for the procedures because my filter is not fix so i have taken @filter as parameter and pass in the procedure.
Declare @query as varchar(8000)
Declare @Filter as varchar(1000)
set @query = 'Select * from Person.Address where 1=1 and ' + @Filter
exec(@query)
Like that my filter contain any Field from the table for comparison.
It will affect my performance or not ?
is there any alternate way to achieve this type of things