Blog Post

Flexibility of T-SQL for designing user defined functions

,

SQL Server has plenty of built-in functions but sometimes we just have to combine some of them to create functions for our purposes. Such one, for example, is the function that returns the number of the days in a month. Before SQL Server 2012 we had to do that by combining more than two inbuilt functions and with SQL Server 2012+ version it’s just a short one-line command.
This post shows seven ways for designing the example function. I’m sure there are some other interesting designs for the same function.