CodeLikeBeaker
CodeLikeBeaker

Reputation: 21312

SQLAlchemy Truncating VARCHAR(MAX)

I'm querying Microsoft SQL Server 2008 with Flask-SQLAlchemy (.16) and SQL Alchemy (0.8.2) in python 2.7.

When I attempt to query the varchar(max) column. It is truncating it to 4096 characters. I've tried different data types in the code. String, Text, VARCHAR.

Any thoughts to get my code to pull all the data from my column?

Here is part of the code:

from web import db

class DynamicPage(db.Model):
    __tablename__ = 'DynamicPage'
    DynamicPageId = db.Column(db.Integer, primary_key=True)
    PageHtml = db.Column(db.VARCHAR)

And the query:

pages = DynamicPage().query.all()

Upvotes: 2

Views: 3612

Answers (1)

zzzeek
zzzeek

Reputation: 75317

Are you using ODBC? FreeTDS? ODBC has a fixed maximum size for large text/binary fields. In FreeTDS you need to set the text size setting to support as large a field as you need.

Upvotes: 2

Related Questions