Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword or section
Like this
2Activity

Table Of Contents

0 of .
Results for:
No results containing your search query
P. 1
SQL Server 2005

SQL Server 2005

Ratings: (0)|Views: 128 |Likes:
Published by pqtung

More info:

Categories:Types, School Work
Published by: pqtung on Sep 26, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

09/11/2012

pdf

text

original

 
1
Mc lc
M
c lc
.................................................................................................................................11Gi
i thiu về SQL Server 2005
......................................................................................51.1
Cài đt SQL Se
rver 2005 Express Edition..............................................................51.1.1Các yêu c
u cho hthng 32bit
.......................................................................51.1.2
Các bưc cài đặt SQL Server 2005 Express Edition
.......................................71.2M
t số thao tác bản tr
ên SQL Server 2005 Express Edition...........................161.2.1T
o mt CSDL mi
.......................................................................................161.2.2T
o bng mi
.................................................................................................171.2.3Xóa b
ng, xóa CSDL
.....................................................................................191.2.4M
một query editor để viết câu lệnh SQL
...................................................192Structured Query Language (SQL)..............................................................................202.1SQL là ngôn ng
ca cơ sdliu quan h
.........................................................202.2Vai trò c
a SQL
....................................................................................................202.3Gi
i thiu sơ lưc vTransact SQL (T
-SQL)......................................................212.3.1Ngôn ng
định nga dliệu (
Data Definition Language
DDL)..............222.3.2Ngôn ng
điu khin dữ liu (Data control language
DCL)......................222.3.3Ngôn ng
thao tác dữ liu (Data manipulation language
DML)................232.3.4Cú pháp c
a T
-SQL.......................................................................................242.3.5Các ki
u dliu
.............................................................................................252.3.6Bi
ến (Variables)
.............................................................................................262.3.7Hàm (Function)..............................................................................................272.3.8Các toán t
(Operators)
.................................................................................272.3.9Các thành ph
n điu khiển (Control of flow)
................................................282.3.10Chú thích (Comment)...................................................................................282.3.11Giá tr
ị NULL
................................................................................................283Ngôn ng
thao tác dliu
DML...............................................................................293.1Câu l
nh SELECT
.................................................................................................293.1.1Danh sách ch
n trong câu lnh SELECT
......................................................303.1.2M
nh đFROM
.............................................................................................343.1.3M
nh đề WHERE
-
điều kin
truy v
n dliu
............................................343.1.4Phép h
p (UNION)
........................................................................................383.1.5Phép n
i
.........................................................................................................413.1.6Các lo
i pp ni
...........................................................................................43
 
23.1.7Phép n
i theo chun SQL
-92.........................................................................453.1.8M
nh đề GROUP BY
....................................................................................473.1.9Truy v
n con (Subquery)
...............................................................................503.2Thêm, c
p nht v
à xóa d
liu
..............................................................................513.2.1Thêm d
liu
..................................................................................................523.2.2C
p nht dliu
.............................................................................................533.2.3Xóa d
liu
.....................................................................................................544Ngôn ng
định nga dli
u
DDL............................................................................564.1T
o bng
................................................................................................................564.2Các lo
i r
àng bu
c
.................................................................................................584.2.1Ràngbu
c CHECK
........................................................................................584.2.2Ràng bu
c PRIMARY KEY
..........................................................................594.2.3Ràng bu
c FOREIGN KEY
..........................................................................604.3S
a đi định nga bng
........................................................................................614.4Xóa b
ng
...............................................................................................................634.5Khung nhìn- VIEW..............................................................................................634.6Thêm, c
p nhật, a dliu trong VIEW
.............................................................654.7
Thay đi định nghĩa khung nh
 ìn...........................................................................654.8Xóa khung nhìn.....................................................................................................665Th
tc lưu tr, h
àm và trigger.....................................................................................675.1Th
tục lưu trữ (Stored procedure)
.......................................................................675.1.1T
o thtc lưu tr
.........................................................................................685.1.2L
i gi thtc
................................................................................................695.1.3Bi
ến trong thtc lưu tr
..............................................................................695.1.4Giá tr
trả về trong thủ tục u tr
.................................................................705.1.5Tham s
với gtrị mc định
.........................................................................715.1.6S
a đi thtc
...............................................................................................725.1.7Xóa th
tc
.....................................................................................................725.2
Hàm do ngưi dùng định nghĩa (User Defined Function
-UDF)...........................725.2.1
Hàm vô hưng
- Scalar UDF.........................................................................735.2.2Hàm n
i tuyến
- Inline UDF..........................................................................745.2.3Hàm bao g
m nhiu câu lệnh b
ên trong
Multi statement UDF..................755.2.4
Thay đổi h
àm.................................................................................................765.2.5Xóa hàm.........................................................................................................775.3Trigger...................................................................................................................77
 
35.3.1
c đc điểm ca trigger
...............................................................................775.3.2
Các trưng hp sdng trigger
.....................................................................775.3.3Kh
ng sau ca trigger
...............................................................................785.3.4
Định nghĩa trigger
..........................................................................................785.3.5Kích ho
t trigger da tr
ên s
thay đi dliu tr
ên c
t
..................................825.3.6S
dụng trigger v
à Giao tác (TRANSACTION)...........................................835.4DDL TRIGGER....................................................................................................845.5Enable/ Disable TRIGGER...................................................................................856
Sao lưu và phục hi dliu (Backup and Restore)
......................................................876.1Các lý do ph
i thực hiện Backup
..........................................................................876.2Các lo
i Backup
....................................................................................................876.2.1Full backup Differential backup...............................................................876.2.2Transaction log backup..................................................................................886.3Các thao tác th
c hiện quá tr
 ình Backup và Restore trong SQL Server 2005Express Edition........................................................................................................................896.3.1
Sao u (Backup)
...........................................................................................896.3.2Ph
c hồi (Restore)
.........................................................................................917Các hàm quan tr
ng trong T
-SQL................................................................................947.1Các hàm làm vi
c vi kiu dliu s
...................................................................947.1.1Hàm ISNUMERIC.........................................................................................947.1.2Hàm ROUND................................................................................................947.2Các hàm làm vi
c vi kiu dliu chui
..............................................................957.2.1Hàm LEFT.....................................................................................................957.2.2Hàm RIGHT..................................................................................................957.2.3Hàm SUBSTRING........................................................................................957.2.4Hàm LEN.......................................................................................................967.2.5Hàm REPLACE.............................................................................................967.2.6Hàm STUFF...................................................................................................967.2.7Hàm LOWER/UPPER...................................................................................977.2.8Hàm LTRIM/RTRIM....................................................................................977.3Các hàm làm vi
c vi kiu dliu Ng
ày tháng/ Th
i gian
..................................977.3.1Hàm GETDATE............................................................................................977.3.2Hàm DAY/ MONTH/ YEAR........................................................................977.3.3Hàm DATEPART..........................................................................................987.3.4Hàm DATENAME........................................................................................99

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->