Need TOP 1 and BOTTOM 1 in one result? UNION fails with two ORDER BY clauses. Here is a simple T-SQL way to retrieve TOP and BOTTOM Rows together.
SQL SERVER – Find All The User Defined Functions (UDF) – Part 2
Madhivanan shared another way to find all the user defined functions in a database, using information_schema.routines. Here is his short script.
SQL SERVER – UDF to Return a Calendar for Any Date for Any Year
Reader Dan Golden built on my weekly calendar function to create a UDF to return a calendar for any date for any year. I fixed a small first and last week bug.
SQL SERVER – Find All The User Defined Functions (UDF) in a Database
A very simple script that lists all the User Defined Functions in a database, with schema name and type, by reading sys.objects in SQL Server.
SQL SERVER – Introduction to Statistical Functions – VAR, STDEVP, STDEV, VARP
VAR, STDEVP, STDEV and VARP are statistical functions that also fit the aggregate function definition. A quick AdventureWorks example shows all four.
SQL SERVER – Introduction to Aggregate Functions
What are Aggregate Functions in SQL Server? The Books Online definition, the full list, and the NULL and GROUP BY rules that candidates often miss.
SQL SERVER – Remove Duplicate Characters From a String
A follow up to my Remove Duplicate Chars From String post: Madhivanan shows how to remove duplicate characters from a string with a Number table approach.







