Querying database schema of SQL Server DB via ODBC?
问题 Is there a generic way to retrieve a database schema using ODBC that works across databases? If not, what is the easiest way to do this when the database server is MS SQL Server? I am working with unixodbc, from Linux. 回答1: Query against the INFORMATION_SCHEMA views. Beautiful thing about using information schema is that it's a standard so it should be portable to any database that has implemented the standard. e.g. SELECT * FROM INFORMATION_SCHEMA.COLUMNS ISC The standard is the SQL-92