1. Michael Bayer
  2. sqlalchemy
  3. Issues

Issues

Issue #3039 resolved

ntext - sql server

Landon Neale
created an issue

In SQL Server 2012, the ntext has been deprecated; however, for sql alchemy 0.9.4 for p2.7, it still uses the ntext in the mssql dialects which causes issues/sql type errors. Found solution in C:\Python2732\Lib\site-packages\sqlalchemy-0.9.4-py2.7.egg\sqlalchemy\dialects\mssql\base.py and replacing references to nvarchar.

Comments (7)

  1. Michael Bayer repo owner

    what type does SQL Server 2012 offer for arbitrarily large text that is unicode ? NVARCHAR is a fixed size; unless SQL Server 2012 allows arbitrary-sized NVARCHAR that's not an option.

  2. Michael Bayer repo owner

    OK so this is TEXT also and they want to use varchar(max).

    However, this means that the Text()/ UnicodeText() types just shouldn't be used with SQL Server. You can instead use String()/Unicode(), which will render as "varchar(max)" / "nvarchar(max)" right now if you don't give them a length.

    As it stands, changing Text/UnicodeText to spit out (n)varchar(max) seems like it would be pretty backwards incompatible/surprising for existing users.

  3. Michael Bayer repo owner
    • SQL Server 2012 now recommends VARCHAR(max), NVARCHAR(max), VARBINARY(max) for large text/binary types. The MSSQL dialect will now respect this based on version detection, as well as the new deprecate_large_types flag. fixes #3039

    → <<cset c8817e608788>>

  4. Log in to comment