title: UNION inside IF EXISTS statement not working
body: <pre><code>SELECT A, B, C FROM TUser
  
  UNION
  
  IF EXISTS(SELECT dataUserId FROM TUserData WHERE DataId = @dataId AND UserId = @userId)
    BEGIN
      SELECT @dataUserId  = dataUserId FROM TUserData WHERE DataId = @dataId AND UserId = @userId
  
      SELECT A, B, C FROM TUser WHERE UserId = dataUserId 
    END
  </code></pre>