SqlServer2005/2008下sysproperties无效的解决办法
if exists (select 1 from sysobjects where name = 'sysproperties'and xtype = 'v')
begindrop view sysproperties
end
go
create view sysproperties
as
select a.name as tablename,
a.id as tableid,b.name as colname,b.colid as colid,
b.xtype as coltype,c.name as propname,c.value as propvalue
from sysobjects as a inner join syscolumns as b on a.id = b.id
inner join sys.extended_properties as c on c.major_id = a.id
and ( minor_id = b.colid)