MSSQL case sensitivity on INFORMATION_SCHEMA still exists
ProgrammingError: (ProgrammingError) ('42S02', "42S02 FreeTDSServerInvalid object name 'information_schema.tables'. (208) (SQLPrepare)") u'SELECT tables_1.table_name \nFROM information_schema.tables AS tables_1 \nWHERE tables_1.table_schema = ?' 'dbo'
The query works if I run it by hand with:
FROM INFORMATION_SCHEMA.TABLES AS tables_1
I can also get it to work with:
=================================================================== --- sqlalchemy/databases/information_schema.py (revision 834) +++ sqlalchemy/databases/information_schema.py (working copy) @@ -11,12 +11,12 @@ Column("schema_owner", String), schema="information_schema")
-tables = Table("tables", ischema, +tables = Table("TABLES", ischema, Column("table_catalog", String), Column("table_schema", String), Column("table_name", String), Column("table_type", String), - schema="information_schema") + schema="INFORMATION_SCHEMA")
This is with SA 0.5.2, Python 2.5, OSX 10.5
Comments (6)
-
Account Deleted -
repo owner what version of SQL server please
-
Account Deleted Claimed to be SQL Server 2005 and indeed using the info at http://support.microsoft.com/kb/321185
SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')
produces
9.00.3042.00 SP2 Standard
-
- changed milestone to 0.5.xx
This will definitely be problematic if you're using a binary collation for your database. We need to change the casing of these items so with a binary collation it will properly find the tables.
-
- changed status to resolved
Fixed in e26b9e5f982be92a57c519e0d9c7b66d9d99a7c0.
-
repo owner - removed milestone
Removing milestone: 0.5.xx (automated comment)
- Log in to comment
And a comment where it's used in mssql.py
TODO this still has a problem with the case of INFORMATION_SCHEMA