SQL Server - Cheat Sheet

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

SQL Server Cheat Sheet

by DaveChild via cheatography.com/1/cs/18/


SQL Server Data Types

SQL Server Grouping (Aggregate) Functions

SQL Server Date Functions

Exact Numerics

AVG

MAX

DATEADD (datepart, number, date)

bit

decimal

BINARY_CHECKSUM

MIN

DATEDIFF (datepart, start, end)

tinyint

money

CHECKSUM

SUM

DATENAME (datepart, date)

smallint

numeric

CHECKSUM_AVG

STDEV

DATEPART (datepart, date)

bigint

COUNT

STDEVP

DAY (date)

Approximate Numerics

COUNT_BIG

VAR

GETDATE()

GROUPING

VARP

GETUTCDATE()

float

real

Date and Time

MONTH (date)

smalldatetime

timestamp

SQL Server Ranking Functions

datetime

RANK

NTILE

Strings

DENSE_RANK

ROW_NUMBER

char

text

varchar

SQL Server String Functions

YEAR (date)
SQL Server Dateparts
yy, yyyy

Year

qq, q

Quarter

ASCII

REPLICATE

mm, m

Month

CHAR

REVERSE

dy, y

Day of Year

CHARINDEX

RIGHT

dd, d

Day

DIFFERENCE

RTRIM

wk, ww

Week

LEFT

SOUNDEX

hh

Hour

LEN

SPACE

mi, n

Minute

LOWER

STR

ss, s

Second

LTRIM

STUFF

ms

Millisecond

NCHAR

SUBSTRING

PATINDEX

UNICODE

SQL Server Mathematical Functions

SQL Server Type Conversion

REPLACE

UPPER

ABS

LOG10

CAST (expression AS datatype)

QUOTENAME

ACOS

PI

ASIN

POWER

ATAN

RADIANS

SQL Server Table Functions

ATN2

RAND

ALTER

DROP

CEILING

ROUND

CREATE

TRUNCATE

COS

SIGN

COT

SIN

DEGREES

SQUARE

EXP

SQRT

FLOOR

TAN

Unicode Strings
nchar

ntext

nvarchar
Binary Strings
binary

image

varbinary
Miscellaneous
cursor

table

sql_variant

xml

CONVERT (datatype, expression)

LOG
Cheatographer

Cheat Sheet

Sponsor

DaveChild

This cheat sheet was published on 19th October,

Envoy, for simple and effective bug management.

cheatography.com/davechild/

2011 and was last updated on 20th October, 2011.

Try it free!

www.addedbytes.com/

http://www.envoyapp.com

You might also like