1. Microsoft Learn
"Views": "A view is a virtual table whose contents are defined by a query. Like a real table
a view consists of a set of named columns and rows of data. ... The query that defines the view can be from one or more tables or from other views..." This source confirms that a view's purpose is to store a query definition.
Source: Microsoft Docs
SQL Server Documentation
"Views".
2. Microsoft Learn
"CREATE VIEW (Transact-SQL)": The documentation states a primary use for views is "To encapsulate complexity... For example
you can expose a view that joins several tables and includes some calculated columns to provide a simple interface to users...". This directly aligns with the scenario of combining data and using calculated columns.
Source: Microsoft Docs
Transact-SQL reference
"CREATE VIEW (Transact-SQL)".
3. Microsoft Learn
"CREATE FUNCTION (Transact-SQL)": This document defines a user-defined scalar function as one that "returns a single data value of the type defined in the RETURNS clause." This confirms why a scalar function is unsuitable for returning a dataset.
Source: Microsoft Docs
Transact-SQL reference
"CREATE FUNCTION (Transact-SQL)".