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

Davechild SQL Server

This SQL Server Cheat Sheet provides a comprehensive overview of SQL Server data types, grouping functions, date parts, string functions, mathematical functions, and table functions. It includes specific commands and syntax for data manipulation, aggregation, and date handling. The document serves as a quick reference for SQL Server users to enhance their database management skills.

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)
5 views1 page

Davechild SQL Server

This SQL Server Cheat Sheet provides a comprehensive overview of SQL Server data types, grouping functions, date parts, string functions, mathematical functions, and table functions. It includes specific commands and syntax for data manipulation, aggregation, and date handling. The document serves as a quick reference for SQL Server users to enhance their database management skills.

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

SQL Server Cheat Sheet

by Dave Child (DaveChild) via [Link]/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 [Link]


[Link]/davechild/ Last updated 13th May, 2016. Measure your website readability!
[Link] Page 1 of 1. [Link]

You might also like