or   Register or Register today to make and share your own cheat sheets! (Why Join?)

Cheatography Login

Join Us!

Not a Cheatographer? Register here!

Social Media

You can login to or register with Cheatography using your Facebook or Twitter account!

Why Join Cheatography?

Make and share cheat sheets!
Join a great community of Cheatographers and add your very own contributions.

Save your favourites!
Quick access to your most loved cheat sheets.

Fewer ads!
Members see no ads on the site.

Coming soon ...
Requests, ratings and more!

Why Join Cheatography?

Make and share cheat sheets!
Join a great community of Cheatographers and add your very own contributions.

Save your favourites!
Quick access to your most loved cheat sheets.

Fewer ads!
Members see no ads on the site.

Coming soon ...
Requests, ratings and more!

SQL Server Cheat Sheet by DaveChild

Comments   |   Add a Comment   |   PDF Download   |   Find:

SQL Server Data Types

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 Type Conversion

CAST (expre­ssion AS datatype)
CONVERT (datatype, expres­sion)

SQL Server Table Functions

ALTER DROP
CREATE TRUNCATE
 

SQL Server Grouping (Aggregate) Functions

AVG MAX
BINARY­_CH­ECKSUM MIN
CHECKSUM SUM
CHECKS­UM_AVG STDEV
COUNT STDEVP
COUNT_BIG VAR
GROUPING VARP

SQL Server Ranking Functions

RANK NTILE
DENSE_RANK ROW_NUMBER

SQL Server String Functions

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 Date Functions

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 Dateparts

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 Mathematical Functions

ABS LOG10
ACOS PI
ASIN POWER
ATAN RADIANS
ATN2 RAND
CEILING ROUND
COS SIGN
COT SIN
DEGREES SQUARE
EXP SQRT
FLOOR TAN
LOG

Favourited by 9 Members:

catspaw82 CyberTron SamCollett cjvalotta turborider Marty sebbu akipta ciphan

Comments

No comments yet. Add yours below!

Add a Comment

Comment:

Contents

A cheat sheet for Microsoft SQL Server.

Column Content Comments Author Updated
- SQL Server Cheat Sheet DaveChild 20 Oct 11
1 SQL Server Data Types 0 DaveChild 10 Oct 11
SQL Server Type Conversion 0 DaveChild 10 Oct 11
SQL Server Table Functions 0 DaveChild 10 Oct 11
2 SQL Server Grouping (Aggregate) Functions 0 DaveChild 10 Oct 11
SQL Server Ranking Functions 0 DaveChild 10 Oct 11
SQL Server String Functions 0 DaveChild 10 Oct 11
3 SQL Server Date Functions 0 DaveChild 10 Oct 11
SQL Server Dateparts 0 DaveChild 10 Oct 11
SQL Server Mathematical Functions 0 DaveChild 10 Oct 11