Skip to content

Instantly share code, notes, and snippets.

T-SQL Stored Procedures & UDFs: A Comprehensive Quick Reference

This document provides a complete reference for Microsoft SQL Server's Transact-SQL (T-SQL) Stored Procedures and User-Defined Functions (UDFs).


1. Core Concepts: Stored Procedures vs. User-Defined Functions (UDFs)

Both are pre-compiled sets of T-SQL statements stored in the database. They promote code reuse, security, and performance. However, they serve different purposes.

@suntong
suntong / MySQL Stored Procedures & User Defined Functions Quick Reference.md
Created July 24, 2025 22:07
MySQL Stored Procedures & User Defined Functions Quick Reference

1. MySQL Stored Procedures & User Defined Functions Quick Reference, by Gpt

1. Stored Procedures

Create Procedure

DELIMITER $$
@suntong
suntong / SQL Standard Set Operations: MS SQL Server vs MySQL.md
Last active July 24, 2025 21:40
SQL Standard Set Operations: MS SQL Server vs MySQL

1. SQL Standard Set Operations: MS SQL Server vs MySQL, by GPT

SQL supports set operations to combine results from multiple SELECT queries. Here’s a comparison of MS SQL Server and MySQL regarding these operations.


1. MS SQL Server

Supported set operations:

@suntong
suntong / 01-gpt.md
Created July 23, 2025 23:18
MySQL SQL Syntax Quick Reference

MySQL SQL Syntax Quick Reference

Database Operations

-- Create a database
CREATE DATABASE dbname;

-- Use a database
USE dbname;
FieldList:
FieldDefinition:
- FieldName: "ClientCode"
FieldType: "String"
FieldDescription: "The unique VETtrak code of the client, up to 10 characters"
MaximumLength: "10"
IsUpdateable: "true"
- FieldName: "Title"
FieldType: "String"
FieldDescription: "The title of the client (Mr, Mrs, Miss, Ms, Dr etc)"
package main
import (
"encoding/csv"
"fmt"
"io"
"log"
"os"
"regexp"
"strconv"
@suntong
suntong / archive.md
Last active December 22, 2024 07:46
gistpost test update
abcd

@suntong
suntong / Checklist.md
Last active September 15, 2024 15:53
  • Project Planning
    • Define project goals
    • Identify stakeholders
    • Create project timeline
  • Development
    • Develop front-end
    • Develop back-end
    • Integrate with API
@suntong
suntong / archive.md
Last active September 3, 2024 18:49
gistpost test update
abcd

@suntong
suntong / archive.md
Last active September 2, 2024 16:11
gistpost test update
abcd