This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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?
Stored procedure
View
Trigger
Scalar function
What is a key advantage of using stored procedures over embedding T-SQL directly in application code?
Stored procedures automatically create indexed views
Stored procedures are precompiled and can include transaction management and error handling
Stored procedures can only be executed by database administrators
Stored procedures automatically encrypt all data
When should you choose a table-valued function over a scalar function?
When you need to return a single calculated value
When you need to modify data in the database
When you need to return a result set that can be used in a FROM clause
When you need automatic execution on data changes
Which type of trigger executes automatically when data is inserted, updated, or deleted in a table?
DDL trigger
Logon trigger
DML trigger
Schema trigger
You must answer all questions before checking your work.
Was this page helpful?
Need help with this topic?
Want to try using Ask Learn to clarify or guide you through this topic?