boolean issue on sql server