SQL server supports identity so the last part of the check is not needed