Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[patch]Cannot connect to SQL2005 - information_schema case sensitive #80

Open
GoogleCodeExporter opened this issue Apr 1, 2015 · 4 comments

Comments

@GoogleCodeExporter
Copy link

In sql 2005, the system tables are hidden and cannot be directly queried,
so the INITIAL_SQL query throws:

Invalid object name 'information_schema.columns'.

Simple fix though - the data is available through built in views, the names
of which are upper case and case sensitive. Patch attached works on sql2000
and sql2005

Original issue reported on code.google.com by [email protected] on 9 Dec 2009 at 10:09

Attachments:

@GoogleCodeExporter
Copy link
Author

This issue was closed by revision a1ffddd1f6.

Original comment by albrecht.andi on 10 Dec 2009 at 5:13

  • Changed state: Fixed
  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Original comment by albrecht.andi on 10 Dec 2009 at 5:14

  • Added labels: Milestone-0.4.2, Version-Development
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Hi, with the revision of albrecht.andi it didn't work for me. 

I had to do it like this:


INITIAL_SQL = """SELECT t.TABLE_CATALOG as table_catalog,
t.TABLE_NAME as table_name, c.COLUMN_NAME as column_name, t.TABLE_TYPE as 
table_type
FROM INFORMATION_SCHEMA.COLUMNS c,
    INFORMATION_SCHEMA.TABLES t
WHERE t.TABLE_NAME = c.TABLE_NAME
      AND t.TABLE_CATALOG = c.TABLE_CATALOG
ORDER BY c.TABLE_CATALOG,
         c.TABLE_NAME,
         c.ORDINAL_POSITION
"""


Original comment by [email protected] on 29 Apr 2011 at 4:50

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

So, the column names are all uppercase too? Which version of SQL Server are you 
using?

Original comment by albrecht.andi on 29 Apr 2011 at 7:35

  • Changed state: Accepted
  • Added labels: FeedbackRequested
  • Removed labels: ****

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant