title: T-SQL: if exists always return true?
body: <p>What do you think , does the Stored Procedure always return 1 ?</p>
  
  <p>I am concerned about the if exists(..)</p>
  
  <pre><code>    BEGIN
  
      DECLARE @IsUserExisting bit
  
   SET NOCOUNT ON
  
      IF Exists
   (
    Select null FROM G_User WHERE
      SamAccountName = @SamAccountName
     AND NetBIOSDomainName = @NetBIOSDomainName   
   )
    BEGIN
       SET @IsUserExisting = 1     
    END
      ELSE
    BEGIN
       SET @IsUserExisting = 0    
    END
  
   Select @IsUserExisting
  
  END
  </code></pre>