SqlServer2005/2008下sysproperties無效的解決辦法

一劍平江湖發表於2014-04-03

SqlServer2005/2008下sysproperties無效的解決辦法


if exists (select 1 from sysobjects where name = 'sysproperties'and xtype = 'v')

begin
    drop 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)

相關文章