Blogs from Wise Owl on Functions in SQL

Showing blogs 1-5 (out of 5)

The new SQL String_Split function for comma-delimited strings

Posted by Andy Brown on 22 March 2021

If you're using SQL Server with compatibility level 130 or greater you can now use the new String_Split function to divide a comma-delimited string into a table of values.

Tags:   SQL | Functions

A table-valued function in SQL to split a comma-delimited list

Posted by Andy Brown on 11 June 2019

If you're creating Reporting Services reports using multivalue parameters and stored procedures, you'll find this function to split a list of values into a single-table column useful.

Tags:   SSRS | Parameters    |    SQL | Functions

Using OUTER and CROSS APPLY joins to link to table-valued functions

Posted by Andy Brown on 03 May 2013

For the sake of completeness, this blog explains how to join to the results of table-valued functions (like a correlated subquery on steroids).

Tags:   SQL | Joins    |    SQL | Functions    |    T-SQL | SQL Tutorial

Scalar User Defined Functions in SQL Server - UDFs

Posted by Andrew Gould on 01 February 2013

If you have a calculation that you frequently use in SQL queries you're probably bored of writing out the same code time after time. Why not try creating a user-defined function to save you the hassle? This blog teaches you how to define your own custom functions, including how to use input parameters, how to alter a function after you've created it, and even how to use fancy programming techniques such as variables and IF statements to help structure complex sequences of calculations.

Tags:   SQL | Functions    |    T-SQL | SQL Tutorial

Calculating Age in SQL with a User-Defined Function

Posted by Andrew Gould on 16 February 2012

A common requirement in SQL queries is calculating a person's age. The expression you need to do this accurately is relatively long, so why not replace it with a user-defined function? This blog shows you how!

Tags:   SQL | Calculations    |    SQL | Functions    |    T-SQL | SQL Tutorial
This page has 0 threads Add post