sqlserver 필드 설명 가 져 오기, 추가, 수정, 삭제

1680 단어 C++cC#asp
http://zoojoo.9box.cn/article.asp?id=152

Select o.name AS tableName, c.name AS columnName, p.[value] AS Description
FROM sysproperties p INNER JOIN
      sysobjects o ON o.id = p.id INNER JOIN
      syscolumns c ON p.id = c.id AND p.smallid = c.colid
Where (p.name = 'MS_Description') AND (c.name = 'province') AND (o.name = 'ip_address')
orDER BY o.name

   ip_address    province   



--        

create   table    (a1   varchar(10),a2   char(2))

--        
EXECUTE   sp_addextendedproperty   N'MS_Description',   '     ',   N'user',   N'dbo',   N'table',   N' ',   NULL,   NULL

--   a1      
EXECUTE   sp_addextendedproperty   N'MS_Description',   '  ',   N'user',   N'dbo',   N'table',   N' ',   N'column',   N'a1'

--   a2      
EXECUTE   sp_addextendedproperty   N'MS_Description',   '  ',   N'user',   N'dbo',   N'table',   N' ',   N'column',   N'a2'
--     a1     :
EXEC   sp_updateextendedproperty   'MS_Description','  1','user',dbo,'table',' ','column',a1

--     a1     :
EXEC   sp_dropextendedproperty   'MS_Description','user',dbo,'table',' ','column',a1

--    
drop   table     


좋은 웹페이지 즐겨찾기