title: How to add generic condition to sp select?
body: <p>I really don't know what to do in this situation, so don't be too harsh. </p>
  
  <p>If I have my select: </p>
  
  <pre><code>declare @Id uniqueidentifier = 'some parent guid'
  declare @Type int = 1 -- can be 1, 2 or 3
  declare @UserType varchar(max) --can be 0, anything else than 0, or all users at once
  
  if(@Type = 1)
  set @UserType = 'and UserType &lt;&gt; 0'
  if(@Type = 2)
  set @UserType = 'and UserType = 0'
  if(@Type = 3)
  set @UserType = ''
      select * from users where parentId = @Id + @UserType 
  </code></pre>
  
  <p>What to do in the situation where condition is "generic"? Do i really need to create 3 different Sp? </p>