diff --git a/sqlalchemy_pytds/dialect.py b/sqlalchemy_pytds/dialect.py index def555e..b54f253 100644 --- a/sqlalchemy_pytds/dialect.py +++ b/sqlalchemy_pytds/dialect.py @@ -171,10 +171,10 @@ def do_execute(self, cursor, statement, parameters, context=None): v = parameters.get(name, None) #print('cvt', name, v) if isinstance(v, str): - assert len(v) < 8000 + assert len(v) <= 4000 parameters[name] = tds_base.Param(name=name, type=tds_types.NVarCharType(size=len(v)), value=v, flags=0) elif isinstance(v, bytes): - assert len(v) < 8000 + assert len(v) <= 8000 parameters[name] = tds_base.Param(name=name, type=tds_types.VarBinaryType(size=len(v)), value=v, flags=0) #print('parm:', parameters) cursor.execute(statement, parameters)