Ajay Mavatkar

Ajay Mavatkar

  • NA
  • 68
  • 12.4k

append dynamic where condition inside sp

Jun 21 2017 2:02 AM
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)