MS SQL uses the wrong way to get view definition
Issue #2071
resolved
viewnames = mssql_insp.get_view_names()
for viewname in viewnames:
vdef = mssql_insp.get_view_definition(viewname)
ends up doing: FROM INFORMATION_SCHEMA.TABLES AS TABLES_1 WHERE TABLES_1.TABLE_SCHEMA = ? AND TABLES_1.TABLE_TYPE = ? ORDER BY TABLES_1.TABLE_NAME
This is broken. Although http://msdn.microsoft.com/en-us/library/ms181381.aspx says that view definitions longer then 4000 characters will be null in fact they are truncated. Instead use sys.sql_modules to get the full view definition. As a poor man fix to this at least don't return truncated view definitions.
Note that this is with 0.6.6.
Comments (3)
-
repo owner -
repo owner - changed status to resolved
-
repo owner - removed milestone
Removing milestone: 0.6.7 (automated comment)
- Log in to comment
will add this to pycon sprints for the moment . Need a patch for MSDialect.get_view_definition.