develog

[MySql] 테이블, 컬럼 코멘트 조회/수정 본문

카테고리 없음

[MySql] 테이블, 컬럼 코멘트 조회/수정

냐옴 2024. 2. 14. 13:42

 

테이블 코멘트 조회/수정

-- 테이블 코멘트 조회
select table_schema, table_name, table_comment
from information_schema.tables
where table_schema = 'my_db'
order by table_schema, table_name
;

-- 테이블 코멘트 수정
alter table tb_member comment '회원정보';

 

컬럼 코멘트 조회/수정

-- 컬럼 코멘트 조회
select table_schema, table_name, column_name, column_comment
from information_schema.columns
where table_schema = 'my_db'
order by table_schema, table_name, ordinal_position
;

-- 컬럼 코멘트 수정
alter table tb_member modify column regist_dt datetime(6) comment '등록일시';

 

Comments