1
Answer

append dynamic where condition inside sp

Ajay Mavatkar

Ajay Mavatkar

7y
221
1
Hi,
 
I have a sp and I need to append the dynamic where condition inside sp.
 
Here is my effort
 
ALTER Procedure [dbo].[sp_searchCities]
(
@Id int,
@where varchar(200)
)
as
begin
select id,City from thlCities @where
end 
 
Here 
@where   =  Where City = 'New York'
 
Can you suggest that how to append the dynamic where in sp 
Answers (1)