0% found this document useful (0 votes)
6 views1 page

Davechild SQL Server

This document is a SQL Server Cheat Sheet that provides a comprehensive overview of SQL Server data types, functions, and commands. It includes sections on exact and approximate numerics, string functions, date functions, and mathematical functions, as well as type conversion and table functions. The cheat sheet serves as a quick reference guide for SQL Server users to efficiently utilize various functionalities.

Uploaded by

Houac Hak
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views1 page

Davechild SQL Server

This document is a SQL Server Cheat Sheet that provides a comprehensive overview of SQL Server data types, functions, and commands. It includes sections on exact and approximate numerics, string functions, date functions, and mathematical functions, as well as type conversion and table functions. The cheat sheet serves as a quick reference guide for SQL Server users to efficiently utilize various functionalities.

Uploaded by

Houac Hak
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

SQL Server Cheat Sheet

by Dave Child (DaveChild) via cheatography.com/1/cs/18/

SQL Server Data Types SQL Server Grouping (Aggre​gate) Functions SQL Server Dateparts

Exact Numerics AVG MAX yy, yyyy Year

bit decimal BINARY​_CH​ECKSUM MIN qq, q Quarter

tinyint money CHECKSUM SUM mm, m Month

smallint numeric CHECKS​UM_AVG STDEV dy, y Day of Year

bigint COUNT STDEVP dd, d Day

Appr​oximate Numerics COUNT_BIG VAR wk, ww Week

float real GROUPING VARP hh Hour

Date and Time mi, n Minute


SQL Server Ranking Functions
smalld​atetime timestamp ss, s Second
RANK NTILE ms Millis​econd
datetime
DENSE_RANK ROW_NUMBER
Stri​ngs
SQL Server Mathem​atical Functions
char text SQL Server String Functions
ABS LOG10
varchar
ASCII REPLICATE ACOS PI
Unicode Strings
CHAR REVERSE ASIN POWER
nchar ntext
CHARINDEX RIGHT ATAN RADIANS
nvarchar
DIFFERENCE RTRIM ATN2 RAND
Binary Strings
LEFT SOUNDEX CEILING ROUND
binary image
LEN SPACE COS SIGN
varbinary
LOWER STR COT SIN
Misc​ell​ane​ous
LTRIM STUFF DEGREES SQUARE
cursor table
NCHAR SUBSTRING EXP SQRT
sql_va​riant xml
PATINDEX UNICODE FLOOR TAN
REPLACE UPPER LOG
SQL Server Type Conversion
QUOTENAME
CAST (expre​ssion AS datatype)

CONVERT (datatype, expres​sion) SQL Server Date Functions

DATEADD (datepart, number, date)


SQL Server Table Functions
DATEDIFF (datepart, start, end)
ALTER DROP
DATENAME (datepart, date)
CREATE TRUNCATE
DATEPART (datepart, date)

DAY (date)

GETDATE()

GETUTC​DATE()

MONTH (date)

YEAR (date)

By Dave Child (DaveChild) Published 19th October, 2011. Sponsored by Readability-Score.com


cheatography.com/davechild/ Last updated 13th May, 2016. Measure your website readability!
www.getpostcookie.com Page 1 of 1. https://readability-score.com

You might also like