SHOW CREATE TABLE in SqlServer

By | February 29, 2016
Share the joy
  •  
  •  
  •  
  •  
  •  
  •  

In Oracle, we can easily get the DDL clause. In mysql, we can use SHOW CREATE TABLE.

In SqlServer, there is no similar command. However, we can get data type by below command:

SELECT name, system_type_name, is_nullable FROM
sys.dm_exec_describe_first_result_set(‘SELECT * FROM table‘, NULL, 0)

  • Devtwo Westlake

    Worked!!! Had to use ” to escape quotes!