create proc GetListsColumnInfoByTableName(@tablename varchar(10)) as begin SELECT z.name as 列名,(case when z.is_identity = 1 then 'PK' else '' end) as 主键,x.name as 类型,max_length as 长度,(case when z.is_nullable = 0 then 'N' else 'Y' end) as 可空 from sys.systypes x inner join sys.all_columns z on x.xusertype = z.user_type_id and z.object_id = (select object_id from sys.all_objects where name = 'Customer') end exec GetListsColumnInfoByTableName 'Customer'
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。