select sys.columns.name,sys.types.name,sys.columns.precision,sys.columns.scale,sys.columns.is_nullable,(select count(*) from sys.IDentity_columns where sys.IDentity_columns.object_ID = sys.columns.object_ID and sys.columns.column_ID = sys.IDentity_columns.column_ID) as is_IDentity,(select value from sys.extended_propertIEs where sys.extended_propertIEs.major_ID = sys.columns.object_ID and sys.extended_propertIEs.minor_ID = sys.columns.column_ID) as description,( SELECT count(*) FROM sysobjects WHERE (name in (SELECT name FROM sysindexes WHERE (ID = a.ID) AND (indID in (SELECT indID FROM sysindexkeys WHERE (ID = a.ID) AND (colID in (SELECT colID FROM syscolumns WHERE (ID = a.ID) AND (name = a.name))))))) AND (xtype = 'PK') ) as is_key from sys.columns,sys.tables,sys.types,syscolumns a where sys.columns.object_ID = sys.tables.object_ID and sys.columns.system_type_ID=sys.types.system_type_ID and a.ID = sys.tables.object_ID and a.ID = sys.columns.object_ID and a.name = sys.columns.name and sys.tables.name='yk_typk' order by sys.columns.column_ID
YPCD numeric 4 0 0 0 NulL 1CDMC varchar 0 0 1 0 NulL 0PYDM varchar 0 0 1 0 NulL 0CDQC varchar 0 0 1 0 NulL 0总结
以上是内存溢出为你收集整理的获取表SQLSERVER 的表结构信息(字段名,长度,精度,类型,NULL,ID,PRI)全部内容,希望文章能够帮你解决获取表SQLSERVER 的表结构信息(字段名,长度,精度,类型,NULL,ID,PRI)所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)