System/OS
2003.04.23 11:08

[sql] alter table 쿼리 예제

Views 12459 Votes 0 Comment 0
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
자주 안쓰니 까먹지ㅡㅡ;;

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] 초간단 Postfix, Covecot, SSL/TLS (SMTP)

    Date2017.12.11 CategorySystem/OS Byhooni Views9323
    Read More
  2. [linux] 간단한 find 명령어 설명(업데이트 해야 함)

    Date2013.04.23 CategorySystem/OS Byhooni Views9111
    Read More
  3. [linux] man 명령어 뽀개기..

    Date2003.04.23 CategorySystem/OS Byhooni Views8723
    Read More
  4. HTTPS와 SSL 인증서

    Date2014.03.11 CategorySystem/OS Byhooni Views7546
    Read More
  5. SVN(Subversion) 설치와 설정 (sasl 인증 적용 포함)

    Date2014.09.11 CategorySystem/OS Byhooni Views5664
    Read More
  6. [windows] 윈도우즈 콘솔에서 정품인증 하는 방법

    Date2017.05.24 CategorySystem/OS Byhooni Views5306
    Read More
  7. [mac] 맥(OSX)에서 NTFS, 윈도우에서 HFS+ 사용하기

    Date2014.03.12 CategorySystem/OS Byhooni Views5117
    Read More
  8. [linux] awk 명령어

    Date2014.03.11 CategorySystem/OS Byhooni Views4955
    Read More
  9. [linux] CentOS 6.5 에서 "Bringing up interface eth0: Determining if ip address 121.78.127.197 is already in use for device eth0..."

    Date2014.04.05 CategorySystem/OS Byhooni Views4838
    Read More
  10. [linux] resolv.con 초기화 되는 문제

    Date2014.04.05 CategorySystem/OS Byhooni Views4616
    Read More
  11. [linux] CentOS Apache Httpd에 https 적용

    Date2014.03.05 CategorySystem/OS Byhooni Views4478
    Read More
  12. [linux] 초간단 SquirrelMail 설치/설정 (다람쥐 메일)

    Date2017.12.11 CategorySystem/OS Byhooni Views4457
    Read More
  13. [linux] split 명령어

    Date2014.03.11 CategorySystem/OS Byhooni Views4305
    Read More
  14. [mac] 맥OSX에서 NTFS 쓰기 기능 활성화

    Date2014.03.12 CategorySystem/OS Byhooni Views4286
    Read More
  15. Mac에서 Node.js 설치하기

    Date2018.09.28 CategorySystem/OS Byhooni Views4187
    Read More
  16. [android] 초간단 HTTP, POST 전송 샘플

    Date2017.02.16 CategorySystem/OS Byhooni Views3449
    Read More
Board Pagination Prev 1 ... 8 9 10 11 12 13 Next
/ 13