Skip to content

Commit 04217a8

Browse files
Merge pull request #53601 from MicrosoftDocs/NEW-sql-dev-module-2
[Implement programmability objects in SQL Server] new module
2 parents 11501cd + 91ef19e commit 04217a8

22 files changed

Lines changed: 1125 additions & 0 deletions
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
### YamlMime:ModuleUnit
2+
uid: learn.wwl.implement-programmability-objects.introduction
3+
title: Introduction
4+
metadata:
5+
title: Introduction
6+
description: "Introduction to implementing programmability objects in SQL Server"
7+
ms.date: 01/22/2026
8+
author: JulianePadrao
9+
ms.author: jupadrao
10+
ms.topic: unit
11+
azureSandbox: false
12+
durationInMinutes: 2
13+
content: |
14+
[!include[](includes/1-introduction.md)]
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
### YamlMime:ModuleUnit
2+
uid: learn.wwl.implement-programmability-objects.summary
3+
title: Summary
4+
metadata:
5+
title: Summary
6+
description: "Summary of implementing programmability objects in SQL Server"
7+
ms.date: 01/22/2026
8+
author: JulianePadrao
9+
ms.author: jupadrao
10+
ms.topic: unit
11+
azureSandbox: false
12+
durationInMinutes: 2
13+
content: |
14+
[!include[](includes/10-summary.md)]
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
### YamlMime:ModuleUnit
2+
uid: learn.wwl.implement-programmability-objects.create-views
3+
title: Create views
4+
metadata:
5+
title: Create views
6+
description: "Learn how to create views in SQL Server to simplify queries, enhance security, and present data effectively."
7+
ms.date: 01/22/2026
8+
author: JulianePadrao
9+
ms.author: jupadrao
10+
ms.topic: unit
11+
ai-usage: ai-generated
12+
azureSandbox: false
13+
labModal: false
14+
durationInMinutes: 6
15+
content: |
16+
[!include[](includes/2-create-views.md)]
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
### YamlMime:ModuleUnit
2+
uid: learn.wwl.implement-programmability-objects.create-stored-procedures
3+
title: Create stored procedures
4+
metadata:
5+
title: Create stored procedures
6+
description: Learn how to create, modify, and implement stored procedures in SQL Server using T-SQL. Understand parameters, error handling, and best practices for encapsulating business logic.
7+
ms.date: 01/22/2026
8+
author: JulianePadrao
9+
ms.author: jupadrao
10+
ms.topic: unit
11+
ai-usage: ai-generated
12+
azureSandbox: false
13+
durationInMinutes: 6
14+
content: |
15+
[!include[](includes/3-create-stored-procedures.md)]
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
### YamlMime:ModuleUnit
2+
uid: learn.wwl.implement-programmability-objects.create-scalar-functions
3+
title: Create scalar functions
4+
metadata:
5+
title: Create scalar functions
6+
description: Learn how to create scalar user-defined functions in SQL Server to encapsulate reusable logic and return single values.
7+
ms.date: 01/22/2026
8+
author: JulianePadrao
9+
ms.author: jupadrao
10+
ms.topic: unit
11+
ai-usage: ai-generated
12+
azureSandbox: false
13+
durationInMinutes: 6
14+
content: |
15+
[!include[](includes/4-create-scalar-functions.md)]
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
### YamlMime:ModuleUnit
2+
uid: learn.wwl.implement-programmability-objects.create-table-valued-functions
3+
title: Create table-valued functions
4+
metadata:
5+
title: Create table-valued functions
6+
description: Learn how to create and use inline and multi-statement table-valued functions in SQL Server to encapsulate query logic and improve code reusability.
7+
ms.date: 01/22/2026
8+
author: JulianePadrao
9+
ms.author: jupadrao
10+
ms.topic: unit
11+
ai-usage: ai-generated
12+
azureSandbox: false
13+
durationInMinutes: 5
14+
content: |
15+
[!include[](includes/5-create-table-valued-functions.md)]
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
### YamlMime:ModuleUnit
2+
uid: learn.wwl.implement-programmability-objects.create-triggers
3+
title: Create triggers
4+
metadata:
5+
title: Create triggers
6+
description: Learn how to create DML and DDL triggers in SQL Server to automate database operations, enforce business rules, and maintain data integrity.
7+
ms.date: 01/22/2026
8+
author: JulianePadrao
9+
ms.author: jupadrao
10+
ms.topic: unit
11+
ai-usage: ai-generated
12+
azureSandbox: false
13+
durationInMinutes: 6
14+
content: |
15+
[!include[](includes/6-create-triggers.md)]
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
### YamlMime:ModuleUnit
2+
uid: learn.wwl.implement-programmability-objects.choosing-when-to-use-each-programmability-object
3+
title: Choose when to use each option
4+
metadata:
5+
title: Choose when to use each option
6+
description: Learn decision criteria for selecting the appropriate SQL Server programmability object—views, stored procedures, functions, or triggers—based on your specific requirements.
7+
ms.date: 01/22/2026
8+
author: JulianePadrao
9+
ms.author: jupadrao
10+
ms.topic: unit
11+
ai-usage: ai-generated
12+
azureSandbox: false
13+
durationInMinutes: 9
14+
content: |
15+
[!include[](includes/7-choosing-when-to-use-each-programmability-object.md)]
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
### YamlMime:ModuleUnit
2+
uid: learn.wwl.implement-programmability-objects.exercise-implement-programmability-objects
3+
title: 'Exercise: Implement programmability objects in SQL Server'
4+
metadata:
5+
title: 'Exercise: Implement programmability objects in SQL Server'
6+
description: "Practice creating views, stored procedures, functions, and triggers in SQL Server."
7+
ms.date: 01/22/2026
8+
author: JulianePadrao
9+
ms.author: jupadrao
10+
ms.topic: unit
11+
azureSandbox: false
12+
durationInMinutes: 45
13+
content: |
14+
[!include[](includes/8-exercise-implement-programmability-objects.md)]
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
### YamlMime:ModuleUnit
2+
uid: learn.wwl.implement-programmability-objects.knowledge-check
3+
title: Knowledge check
4+
metadata:
5+
title: Knowledge check
6+
description: "Test your understanding of SQL Server programmability objects"
7+
ms.date: 01/22/2026
8+
author: JulianePadrao
9+
ms.author: jupadrao
10+
ms.topic: unit
11+
azureSandbox: false
12+
durationInMinutes: 3
13+
quiz:
14+
title: Check your knowledge
15+
questions:
16+
- content: "Which programmability object should you use when you need to simplify a complex query that joins multiple tables and expose only specific columns to users?"
17+
choices:
18+
- content: "Stored procedure"
19+
isCorrect: false
20+
explanation: "Stored procedures are better suited for operations that modify data or contain procedural logic. Views are more appropriate for simplifying read queries."
21+
- content: "View"
22+
isCorrect: true
23+
explanation: "Views act as virtual tables that encapsulate SELECT queries, making them ideal for simplifying complex joins and controlling which columns users can access."
24+
- content: "Trigger"
25+
isCorrect: false
26+
explanation: "Triggers automatically execute in response to data modifications or database events. They aren't designed for simplifying query access."
27+
- content: "Scalar function"
28+
isCorrect: false
29+
explanation: "Scalar functions return single values and are used for calculations, not for simplifying multi-table queries."
30+
- content: "What is a key advantage of using stored procedures over embedding T-SQL directly in application code?"
31+
choices:
32+
- content: "Stored procedures automatically create indexed views"
33+
isCorrect: false
34+
explanation: "Stored procedures don't automatically create indexed views. This is unrelated to the benefits of stored procedures."
35+
- content: "Stored procedures are precompiled and can include transaction management and error handling"
36+
isCorrect: true
37+
explanation: "Stored procedures are precompiled for better performance, support transaction management with BEGIN TRANSACTION/COMMIT/ROLLBACK, and include TRY...CATCH error handling."
38+
- content: "Stored procedures can only be executed by database administrators"
39+
isCorrect: false
40+
explanation: "Stored procedures can be granted EXECUTE permissions to any user or role, not just administrators."
41+
- content: "Stored procedures automatically encrypt all data"
42+
isCorrect: false
43+
explanation: "Stored procedures don't automatically encrypt data. Data encryption requires separate implementation."
44+
- content: "When should you choose a table-valued function over a scalar function?"
45+
choices:
46+
- content: "When you need to return a single calculated value"
47+
isCorrect: false
48+
explanation: "Scalar functions return single values. Use a scalar function when you need a single calculated result."
49+
- content: "When you need to modify data in the database"
50+
isCorrect: false
51+
explanation: "Neither scalar nor table-valued functions can modify data. Use stored procedures for data modifications."
52+
- content: "When you need to return a result set that can be used in a FROM clause"
53+
isCorrect: true
54+
explanation: "Table-valued functions return result sets that can be joined with other tables or used in FROM clauses, making them ideal when you need to return multiple rows."
55+
- content: "When you need automatic execution on data changes"
56+
isCorrect: false
57+
explanation: "Triggers execute automatically on data changes, not functions."
58+
- content: "Which type of trigger executes automatically when data is inserted, updated, or deleted in a table?"
59+
choices:
60+
- content: "DDL trigger"
61+
isCorrect: false
62+
explanation: "DDL triggers respond to schema changes like CREATE, ALTER, and DROP statements, not data modifications."
63+
- content: "Logon trigger"
64+
isCorrect: false
65+
explanation: "Logon triggers execute when a user session is established, not when data is modified."
66+
- content: "DML trigger"
67+
isCorrect: true
68+
explanation: "DML (Data Manipulation Language) triggers fire automatically in response to INSERT, UPDATE, or DELETE operations on tables or views."
69+
- content: "Schema trigger"
70+
isCorrect: false
71+
explanation: "Schema trigger isn't a standard SQL Server trigger type. DDL triggers handle schema-related events."

0 commit comments

Comments
 (0)