sql server - Dynamicaly build search query in MS SQL -
i have table tbllocation
stores data in following way
locationid |propertyname |propertyvalue ------------------------------------------------ 1 |type |city 1 |name |los angeles 1 |state |california 1 |populationdensity |8092 2 |type |city 2 |name |houstan 2 |state |texas 2 |populationdensity |3501
the front end application sent search criteria in following format stored procedure.
{{@@state!!<equals>##california??}[or]{@@state!!<equals>##texas??}}[and]{@@populationdensity!!<greater than>##3000??}
currently above string parsed , dynamic sql statement created in stored procedure.
is there better way without using dynamic sql? cannot change input format stored procedure.
Comments
Post a Comment