首页 > 代码库 > ShowDoc 快速创建表结构MSSQL语句

ShowDoc 快速创建表结构MSSQL语句

SELECT ‘| ‘+A.column_name+‘ | ‘+A.column_type+‘(‘+cast(A.max_length as nvarchar(40))+‘)‘+‘ | ‘ + CASE WHEN A.is_nullable = 1 THEN ‘是‘ ELSE ‘否‘ END +‘|           |         |‘ FROM (SELECT name AS column_name,TYPE_NAME(system_type_id) AS column_type,max_length,is_nullableFROM sys.columnsWHERE object_id=OBJECT_ID(N‘表名‘)) A

  

ShowDoc 快速创建表结构MSSQL语句