码迷,mamicode.com
首页 > 数据库 > 详细

ShowDoc 快速创建表结构MSSQL语句

时间:2016-08-26 10:30:41      阅读:260      评论:0      收藏:0      [点我收藏+]

标签:

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_nullable
FROM sys.columns
WHERE object_id=OBJECT_ID(N‘表名‘)) A

  

ShowDoc 快速创建表结构MSSQL语句

标签:

原文地址:http://www.cnblogs.com/fastsnail/p/5809238.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!