SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

123 TSQL functions

By Joseph Gama,

This is a collection of 123 TSQL functions for professional, academic or learning purposes. There are many conversions hexadecimal/octal/binary/Roman numerals, mathematical functions such as hyperbolic, logic and trigonometric. Combinatorial functions such as combinations, permutations (factorial), arrangements. Other interesting functions include turning a number into plain English, Morse code, EBCDIC and vice-versa, Levenshtein Distance (linguistics), encryption, infinite precision division and number theory functions: primes, deficient, perfect, abundant, golden numbers. Validation: valid email, IP, ZIP code and many others. There are some useful string functions to count occurrences of a string within another, find a character position in a string from the end of the string, wrap, rewrap, unwrap a string, etc…

Total article views: 875 | Views in the last 30 days: 4
Related Articles

Retrieve numbers from a string

This function will take a string parameter and find all numbers in it.


Insert Commas Into Number String

Function to take a number as a string and return it with commas separating thousands, millions, etc....


Conver Number to string ( exp. 9 - 0009 or 9 - 09)

This Function convert integer to string with N number of ceros to the left


Split String Function

This In-line Table Valued Function returns a table with individual records parsed from a string.


Extracting a specific number of words from a string in sql

Function to extract x number of words from the start of a string