 execute @ret = GetOfficerCode @Officer
      if @ret <> 1
        begin
          select null,Name from Errors where Error = @ret
          return @ret
        end
      if(@ByOfficer = 0 and not exists(select 1 from HBQuerySignNew as a where a.QueryID = @QueryID)) --  