SQL 修改表字段注釋

2021-07-22 08:20:29 字數 1989 閱讀 1146

sqlserver

表注釋if ((select count(*) from fn_listextendedproperty('ms_description','user', n'dbo','table', n'maa_hinmoku',n'column', n'fvhinmezai')) > 0)

--exec sp_updateextendedproperty @name = n'ms_description', @value = n'系統操作日誌資訊',@level0type = 'schema', @level0name = n'dbo',@level1type = 'table', @level1name = n'newtable'

exec sp_updateextendedproperty n'ms_description', n'品目番號(材料)',n'user', n'dbo', n'table', n'maa_hinmoku', n'column', n'fvhinmezai';

else

--exec sp_addextendedproperty @name = n'ms_description', @value = n'系統操作日誌資訊', @level0type = 'schema', @level0name = n'dbo', @level1type = 'table', @level1name = n'newtable'

exec sp_addextendedproperty n'ms_description', n'品目番號(材料)',n'user', n'dbo', n'table', n'maa_hinmoku', n'column', n'fvhinmezai';

go表中字段注釋

/*if ((select count(*) from fn_listextendedproperty('ms_description','schema', n'dbo','table', n'newtable','column', n'logdataid')) > 0) 

--exec sp_updateextendedproperty @name = n'ms_description', @value = n'日誌資訊id', @level0type = 'schema', @level0name = n'dbo', @level1type = 'table', @level1name = n'newtable', @level2type = 'column', @level2name = n'logdataid'

exec sp_updateextendedproperty n'ms_description',n'日誌資訊id','schema',n'dbo','table',n'newtable','column',n'logdataid'

else

--exec sp_addextendedproperty @name = n'ms_description', @value = n'日誌資訊id', @level0type = 'schema', @level0name = n'dbo', @level1type = 'table', @level1name = n'newtable', @level2type = 'column', @level2name = n'logdataid'

exec sp_addextendedproperty n'ms_description',n'日誌資訊id','schema',n'dbo','table',n'newtable','column',n'logdataid'

go*/

select count(*) from fn_listextendedproperty('ms_description','schema', n'dbo','table', n'maa_hinmoku',n'column', n'logdataid');

oracle 

comment on table "studemo"."test_jyucyo"  is '受注';

comment on column "studemo"."test_jyucyo"."fdjyucyodt" is '受番日付';

SQL 查詢表結構資訊 表字段注釋

查詢表結構資訊 select case when a.colorder 1 then i.name d.name else end 表名,a.name 欄位名,isnull g.value as 說明 a.colorder 字段序號,case when select count 1 from sys...

oracle之修改表字段的sql

用慣了pl sql開發,那些基礎的sql語句都忘記不少了。比如這個修改表字段 alter table patrol lines powercut modify powercut cause varchar2 400 task planning varchar2 400 powercut desc v...

oracle修改表字段

增加字段 alter table docdsp add dspcode char 200 刪除字段 alter table table name drop column column name 修改字段型別 alter table table name alter column column nam...