select a.COLUMN_NAME,a.DATA_TYPE,a.CHARACTER_MAXIMUM_LENGTH,b.value
from information_schema.COLUMNS as a
left join sys.extended_properties as b on a.TABLE_NAME=OBJECT_NAME(b.major_id)
and a.ORDINAL_POSITION=b.minor_id
where a.TABLE_NAME=‘tableName‘
查询包含某字段的所有表
select object_name(id) objName,Name as colName
from syscolumns
where (name like‘%你要查询的字段名%‘)
and id in(select id from sysobjects where xtype=‘u‘)
order by objname
触发器
查看一个表的触发器
exec sp_helptrigger t_Other
查看某个触发器的代码
exec sp_helptext ‘触发器名‘