Skip to content
Advertisement

Trying to update where clause to only apply to a certain value

I have a stored procedure in my database. It is a dynamic piece of code and runs for multiple different parameters.

Let’s say I have a parameter called @Param that gets passed: 17 (this parameter will be different for different processes).

In my query I am attempting to use this parameter to update the WHERE clause like this:

Does code like this make sense? I’m trying to only apply this WHERE clause: (val2 in (‘h1′,’h2’) to @Param=17

Advertisement

Answer

You seems to want :

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement