Study FAQ
When should I use a view, function, or stored procedure for Fabric Warehouse transformations?
Also asked as 2
- Which reusable T-SQL object fits a Fabric Warehouse data-preparation rule?
- How do views, functions, and stored procedures differ in a Fabric transformation design?
Answer
Use a view for a reusable query projection, a supported function for computation that participates in queries, and a stored procedure for a controlled sequence of T-SQL statements. Choose the object for its responsibility, then verify the current Fabric Warehouse T-SQL surface.
A view can standardize selected columns, joins, filters, or derived values for several consumers. Creating it does not materialize a separately validated copy of its results. A function is useful for narrowly scoped reusable query logic; do not assume every SQL Server function type is supported unchanged in Fabric.
A stored procedure can encapsulate a multi-statement transformation or a supported write sequence. Define its inputs, expected effects, failure behavior, and whether it is safe to rerun. A pipeline can invoke it as one step within a larger workflow.
The lakehouse SQL analytics endpoint can also define supported query objects, but it cannot manipulate underlying lakehouse data with Warehouse-style DML. Read-only access to data and permission to define query metadata are different capabilities.
Full explanation
DP-600: Transforming and Cleaning Data in Microsoft Fabric
Study guide · DP-600
Read the full explanation