System/OS
2003.04.23 11:08

[sql] alter table 쿼리 예제

조회 수 12523 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
자주 안쓰니 까먹지ㅡㅡ;;

Table 수정 관련 쿼리 형식
ALTER TABLE 테이블명 ADD '컬럼명' '컬럼타입';
ALTER TABLE 테이블명 CHANGE '변경할 컬럼명' '새로운 컬럼명' '컬럼 타입';
ALTER TABLE 테이블명 MODIFY '컬럼명' '컬럼 타입';

## MSSQL 에서는.. ##
ms-sqlserver에서 table 또는 필드 속성변경은 alter문을 사용하여 합니다. 

< 필드의 데이타타입 변경 >
alter table table명
alter column 필드명 datatype

ex) test table의 fld필드를 varchar -> int로 변경 
alter table test
alter column fld int

참고) 실제 입력 되어있는 자료중 int형식으로 변경할 수 없는 경우,
(''aaa''값과 같이)에는 sqlserver는 에러를 냅니다. 

< table에 새로운 필드 추가 >
alter table table명
add 필드명 datatype

ex) test table의 fld1을 varchar 데이타타입 8자리로 추가하는 경우 
alter table test 
add fld1 varchar(8)

?

  1. [linux] 프로세스 상태확인(ps)

    Date2003.04.23 CategorySystem/OS Byhooni Views12774
    Read More
  2. [linux] 간단한 NAT 설정 script

    Date2003.04.23 CategorySystem/OS Byhooni Views12662
    Read More
  3. [doc] 피쳐셀렉션(feature selection using..) 발표 자료

    Date2013.04.23 CategorySystem/OS Byhooni Views12615
    Read More
  4. [linux] 스케쥴링 순서(nice) 변경하기

    Date2003.04.23 CategorySystem/OS Byhooni Views12607
    Read More
  5. [sql] alter table 쿼리 예제

    Date2003.04.23 CategorySystem/OS Byhooni Views12523
    Read More
  6. [linux] DNS(Domain Name System) 설치, 설정

    Date2003.04.23 CategorySystem/OS Byhooni Views12522
    Read More
  7. [linux] root도 삭제하지 못하는 파일 속성

    Date2003.04.23 CategorySystem/OS Byhooni Views12460
    Read More
  8. [mac] Charlesproxy 간단한 설정 내용~

    Date2013.11.12 CategorySystem/OS Byhooni Views12445
    Read More
  9. [linux] X환경 GNOME에서 KDE로 바꾸는 법..

    Date2013.04.23 CategorySystem/OS Byhooni Views12416
    Read More
  10. [linux] iconv를 이용하여 euc-kr 문서를 utf-8로 대량으로 변환하기

    Date2014.01.09 CategorySystem/OS Byhooni Views12295
    Read More
  11. [linux] 파일내 문자열 찾아 바꾸기

    Date2013.04.23 CategorySystem/OS Byhooni Views12275
    Read More
  12. [linux] 데스크탑환경(GNOME/KDE) 바꾸기..

    Date2003.04.23 CategorySystem/OS Byhooni Views12209
    Read More
  13. [linux] /etc/fstab 설정 방법.. ㅋㅋ

    Date2013.04.23 CategorySystem/OS Byhooni Views12162
    Read More
  14. [linux] 쉘 스크립트 (Shell Script)

    Date2003.04.23 CategorySystem/OS Byhooni Views12116
    Read More
  15. [unix] SUN Solaris 싱글모드.. ㅡ,.ㅡ;

    Date2003.04.23 CategorySystem/OS Byhooni Views12055
    Read More
  16. [linux] 텔넷, FTP 텍스트 모드에서 사용

    Date2003.04.23 CategorySystem/OS Byhooni Views12005
    Read More
Board Pagination Prev 1 ... 6 7 8 9 10 13 Next
/ 13