DrSchool Learn coding, fast.
EN AR BN CS DE EL Search

SQL Server T-SQL: Syntax

SQL Server T-SQL syntax starter + common patterns.

Read time: 1 min Words: 30
My Progress

SQL Server T-SQL — Syntax

Hello World

// Hello World in SQL Server T-SQL
Hello, World!

Common patterns

Note: some languages differ. This page is a starter cheat sheet you can expand.

Comments

// line comment
/* block comment */

Variables (example)

// var / let / const / or language-specific syntax

Conditionals

// if / else

Loops

// for / while

Functions

// define a function