sir, i try like below
create procedure abc
@sql varchar(100)
as
begin
select * from [accomodation] where @sql
end
it gives error
An expression of non-boolean type specified in a context where a condition is expected, near 'end'.
plz help me.
You will have to use Dynamic SQL
create procedure abc @sql varchar(100) as begin exec ('select * from [accomodation] where ' + @sql) end
and to test it
--To call exec abc ' country = ''canada'''
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.