Select |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SQL Server Cheat Sheet
SQL Server Data Types
Exact Numerics |
bit |
decimal |
tinyint |
money |
smallint |
numeric |
bigint |
Approximate 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
|
|
|
|
|
|
|
|
Today, there have been 12 visitors (15 hits) on this page! |
|
|
|
|
|
|
|