sqlmapproject/sqlmap · error · NotSupportedError

unsupported TDS column type 0x%02x

Error message

unsupported TDS column type 0x%02x

What it means

Error "unsupported TDS column type 0x%02x" thrown in sqlmapproject/sqlmap.

Source

Thrown at extra/dbwire/tds.py:365

        col.binary = True
    elif t == 0xf1:  # XML (value arrives PLP-encoded UTF-16, no size in TYPE_INFO)
        if _u8(data, off):  # schema-present: B_VARCHAR dbname, B_VARCHAR owner, US_VARCHAR collection
            off += 1
            for _ in range(2):
                off += 1 + _u8(data, off) * 2
            off += 2 + struct.unpack("<H", data[off:off + 2])[0] * 2
        else:
            off += 1
    elif t == 0x62:  # SQL_VARIANT (4-byte max length; per-value base type carried in the body)
        col.size = struct.unpack("<i", data[off:off + 4])[0]; off += 4
    elif t in (0x23, 0x63, 0x22):  # TEXT/NTEXT/IMAGE
        col.size = struct.unpack("<i", data[off:off + 4])[0]; off += 4
        if t in (0x23, 0x63):
            col.collation = data[off:off + 5]; off += 5
        col.binary = (t == 0x22)
        # table name (num parts + parts) follows in COLMETADATA for these; handled by caller via name read
    else:
        raise NotSupportedError("unsupported TDS column type 0x%02x" % t)
    return col, off

def _read_plp(data, off):
    # PLP (partially-length-prefixed) body: 8-byte total len (or 0xFF..FF NULL / 0xFF..FE unknown) then chunks
    total = struct.unpack("<Q", data[off:off + 8])[0]; off += 8
    if total == 0xffffffffffffffff:
        return None, off
    out = b""
    while True:
        (clen,) = struct.unpack("<I", data[off:off + 4]); off += 4
        if clen == 0:
            break
        out += data[off:off + clen]; off += clen
    return out, off

def _decode_value(col, data, off):
    t = col.type
    # fixed-length

View on GitHub (pinned to 0a35b20e39)

When it happens

Trigger: Thrown at extra/dbwire/tds.py:365 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of sqlmapproject/sqlmap@0a35b20e39 (2026-08-26). Data as JSON: /api/errors/5f65b3af1abb03f5. Report an issue: GitHub.