The following table lists Information Schema views that are supported by SQL Server Compact 3.5.
View | Contains information about |
COLUMNS | Columns accessed to the current user in the current database |
INDEXES | Indexes in the current database. |
KEY_COLUMN_USAGE | Keys in the current database. |
PROVIDER_TYPES | Data types supported in SQL Server Compact 3.5. |
TABLES | Tables accessible to the current user in the current database. |
TABLE_CONSTRAINTS | Table constraints in the current database. |
REFERENTIAL_CONSTRAINTS | Foreign constraint in the current database. |
对于TABLES, 有如下的Columns:
TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE, TABLE_GUID, DESCRIPTION, TABLE_PROPID, DATE_CREATED, DATE_MODIFIED.
比如搜索一下名字为T_TEST的table:
SELECT *
FROM INFORMATION_SCHEMA.TABLES
WHERE (table_name = 'T_test')
这个在创建Table时首先判断该Table是否存在很有效。