SQL Server数据类型

Exact Numerics

bit

decimal

tinyint

money

smallint

numeric

bigint

Appr­oximate Numerics

float

real

Date and Time

smalld­atetime

timestamp

datetime

Stri­ngs

char

text

varchar

Unicode Strings

nchar

ntext

nvarchar

Binary Strings

binary

image

varbinary

Misc­ell­ane­ous

cursor

table

sql_va­riant

xml

SQL Server类似转换

CAST (expre­ssion AS datatype)

CONVERT (datatype, expres­sion)

SQL Server 表格函数

ALTER

DROP

CREATE

TRUNCATE

SQL Server分组(聚合)函数

AVG

MAX

BINARY­_CH­ECKSUM

MIN

CHECKSUM

SUM

CHECKS­UM_AVG

STDEV

COUNT

STDEVP

COUNT_BIG

VAR

GROUPING

VARP

SQL Server 排名函数

RANK

NTILE

DENSE_RANK

ROW_NUMBER

SQL Server字符串函数

ASCII

REPLICATE

CHAR

REVERSE

CHARINDEX

RIGHT

DIFFERENCE

RTRIM

LEFT

SOUNDEX

LEN

SPACE

LOWER

STR

LTRIM

STUFF

NCHAR

SUBSTRING

PATINDEX

UNICODE

REPLACE

UPPER

QUOTENAME

SQL Server日期函数

DATEADD (datepart, number, date)

DATEDIFF (datepart, start, end)

DATENAME (datepart, date)

DATEPART (datepart, date)

DAY (date)

GETDATE()

GETUTC­DATE()

MONTH (date)

YEAR (date)

SQL Server 日期部分

yy, yyyy

Year

qq, q

Quarter

mm, m

Month

dy, y

Day of Year

dd, d

Day

wk, ww

Week

hh

Hour

mi, n

Minute

ss, s

Second

ms

Millis­econd

SQL Server 数学函数

ABS

LOG10

ACOS

PI

ASIN

POWER

ATAN

RADIANS

ATN2

RAND

CEILING

ROUND

COS

SIGN

COT

SIN

DEGREES

SQUARE

EXP

SQRT

FLOOR

TAN

LOG