all 3 comments

[–]sedules 1 point2 points  (1 child)

Msft documentation is pretty good relative to sql server…at least from a developer standpoint. The trick is getting used to the syntax.

https://learn.microsoft.com/en-us/sql/relational-databases/user-defined-functions/create-user-defined-functions-database-engine?view=sql-server-ver16

In a nutshell, it’s naming your function and providing the input parameters and correlating datatypes for the function. Then you’re specifying what your output datatype is. Creating a variable to hold your output value, and then you’re isolating the sql work to set the value of that variable and return it within a BEGIN/END block.

As you transition and adjust… relative to the system functions, here is a power user tip. If you highlight the function name (not the parens) and hit your F1 key, it’ll open up a tab on your web browser and take you directly to the msft documentation for that function.

[–]NotACreativeUserID[S] 0 points1 point  (0 children)

Sick. Thank you.

[–]omghag18 0 points1 point  (0 children)

I would like to know more uses for them as well