From the course: Microsoft SQL Server 2022 Essential Training

Unlock this course with a free trial

Join today to access over 24,100 courses taught by industry experts.

Leverage user-defined scalar functions

Leverage user-defined scalar functions - SQL Server Tutorial

From the course: Microsoft SQL Server 2022 Essential Training

Leverage user-defined scalar functions

- [Instructor] If you find that you're processing a column of data in the same way on a regular basis and there isn't a built in function to do the work for you, then you can often simplify the process by creating your own custom scaler function. Scaler functions is just a fancy way of saying a function that returns a single value. Most of SQL servers built in functions are scaler. The count function, for example, doesn't matter how many records you feed into it, it will always return just a single number. In the Wide World Importer's database, there is a table that I want to take a look at. It's all the way down at the very bottom in the warehouse schema. It's called Warehouse.VehicleTemperatures. Let's create a new query to take a look at the raw data that the table contains. I'll just select everything from the table. Make sure you're targeting the Wide World Importers database, and press execute. Now, this table…

Contents