Search code examples
sql-server-ce

How can I run a "DESCRIBE" on INFORMATION_SCHEMA views in SQLCompact?


When I want to "DESCRIBE" a table in SQL Server or SQL Server CE. I use a query like the following:

SELECT COLUMN_NAME, IS_NULLABLE, DATA_TYPE 
FROM INFORMATION_SCHEMA.COLUMNS 
WHERE TABLE_NAME= 'MY_TABLE_NAME'

This returns something similar to a DESCRIBE query in Oracle.

However, I cannot find any way to run a query that will show me all of the columns in the views of INFORMATION_SCHEMA (ie. DESCRIBE INFORMATION_SCHEMA.COLUMNS) . Any idea how to expose those column names and types via a query?


Solution

  • There is no way to do that, but you can use DbDataReader.GetSchemaTable based on SELECT * FRom the view in ado.net