--새로데이터베이스 컨텍스트로 이동
USE DOTNET6TH
--1. Contect 신규 데이터 삽입
INSERT INTO Contact (Name, Phone, Email)
VALUES ('장동건', '011-9425-0000', 'jang!!!test@nate.com')
INSERT INTO Contact
VALUES ('고소영', '011-777-7777', 'go!!!test@nate.com')
INSERT INTO Contact (Name, Phone, Email)
VALUES ('김윤석', 'kim!!!test@nate.com', '011-000-1234')
INSERT Contact (Name, Phone, Email)
VALUES ('이나영', 'lee!!!test@nate.com', '011-777-1234')
SELECT * FROM Contact
--2. Contact 테이블의 데이터 수정
UPDATE Contact
SET
Phone = '010-9999-9999',
Email = 'MS-Phone@ms.com'
---3. Contact 테이블 데이터 삭제
DELETE FROM Contact
DELETE contact
UPDATE Contact
SET
Phone = '010-9999-9999',
Email = 'MS-Phone@ms.com'
WHERE
Name = '장동건'
DELETE FROM Contact WHERE Name = '장동건'
DELETE contact WHERE Name = '장동건'
'프로그램 > MSSQL SERVER 2008R2' 카테고리의 다른 글
MSSQL DB - EX07 (1) | 2010.10.08 |
---|---|
D20 - EX06 (DECLARE , IF - ELSE, CASE - WHEN, WHILE- BREAK, GOTO, TRY - CATCH ,SQL SYSTEM FUNCTIONs) (0) | 2010.10.07 |
D19 - EX04 JOIN ( INNER JOIN , OUTER JOIN, CROSS JOIN, UNION JOIN) (0) | 2010.10.05 |
D18 - EX03 GROUP BY, HAVING, ORDER BY 기능활용 (SUM, AVG, COUNT, MIN, MAX 기능) (0) | 2010.10.04 |
D18 - EX02 (DB활용, DROP 활용) (0) | 2010.10.04 |