Basics
Batch Separators
Batch Separators combine one or more SQL statements that are sent to the engine as one set of statements.
Any variable declared in the current batch will not be visible in the next batch.
Variables
Functions
String Functions
SUBSTRING()
REPLACE()
Mathematical Functions
ROUND()
CIEL()
Date Functions
Function | |
---|---|
ISDATE() | validates date and time |
GETDATE() | return current date and time |
DATEFROMPARTS() | requires year, month and day |
DATETIMEFROMPARTS() | requires year, month, day along with hour, minute, second, millisecond |
DATEADD() | can add/subract to/from date and time |
EOMONTH() | returns the last date of the specified month
|
DATEDIFF() | returns the difference between the specified dates |
DATENAME() | DATEPART() |
---|---|
|
|
Output February (Name of the Month) | Output 2 (Numerical representation of the month) |
Window Functions
Value Window Functions
FIRST_VALUE(), LAG(), LAST_VALUE(), LEAD()
MERGE
MERGE
Last updated