Equivalente del DESC de MySQL para MSSQL

  • 21 Dic 2010
  • MSSQL

Correr la siguiente consulta simplemente cambiando 'Products' por el nombre de la tabla de la que se quiere obtener su estructura.

SELECT
    column_name, data_type, column_default, is_nullable
FROM information_schema.tables AS a
 INNER JOIN information_schema.columns AS b
 ON  a.table_catalog = b.table_catalog
 AND a.table_schema  = b.table_schema
 AND a.table_name    = b.table_name
WHERE a.table_name = 'Products';