code: def submit_bulk(self, metadata, rows):
          
          logger.info('Sending INSERT BULK')
          num_cols = len(metadata)
          w = self._writer
          serializers = []
          with self.querying_context(tds_base.PacketType.BULK):
              w.put_byte(tds_base.TDS7_RESULT_TOKEN)
              w.put_usmallint(num_cols)
              for col in metadata:
                  if tds_base.IS_TDS72_PLUS(self):
                      w.put_uint(col.column_usertype)
                  else:
                      w.put_usmallint(col.column_usertype)
                  w.put_usmallint(col.flags)
                  serializer = col.choose_serializer(
                      type_factory=self._tds.type_factory,
                      collation=self._tds.collation,
                  )
                  type_id = serializer.type
                  w.put_byte(type_id)
                  serializers.append(serializer)
                  serializer.write_info(w)
                  w.put_byte(len(col.column_name))
                  w.write_ucs2(col.column_name)
              for row in rows:
                  w.put_byte(tds_base.TDS_ROW_TOKEN)
                  for i, col in enumerate(metadata):
                      serializers[i].write(w, row[i])
  
              # https://msdn.microsoft.com/en-us/library/dd340421.aspx
              w.put_byte(tds_base.TDS_DONE_TOKEN)
              w.put_usmallint(tds_base.TDS_DONE_FINAL)
              w.put_usmallint(0)  # curcmd
              # row count
              if tds_base.IS_TDS72_PLUS(self):
                  w.put_int8(0)
              else:
                  w.put_int(0)
docs: Sends insert bulk command.
  
          Spec: http://msdn.microsoft.com/en-us/library/dd358082.aspx
  
          :param metadata: A list of :class:`Column` instances.
          :param rows: A collection of rows, each row is a collection of values.
          :return: