T-SQL for UDFs

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+ versions it’s just a short one-line command.

This post shows seven ways for designing an example function. I’m sure there are some other interesting designs for the same function.


Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.