Advanced SQL elements
This section will encompass the most complex and advanced elements in handling SQL Server. We will see, among other things, how to manage stored procedures and Triggers, how to create and execute views...
-
Views in SQL
We can define a VIEW as a virtual table with its set of rows and columns, whose content is defined by a SELECT query on one or more tables
Runnable examples
-
Stored procedures in Transact SQL
Stored procedures are sets of one or more instructions stored in the database, which can be called from another part of the application. Stored procedures allow you to receive input and/or output parameters
-
Triggers in Transact SQL
Triggers are a special type of stored procedures that are automatically executed when a specific event occurs in the database.
What you will learn in this section
The objects in this section store logic inside the database itself, so it can be reused and always applies the same way, no matter who runs it.
- Views: a saved, named query that you use like a table. You can create and query one right in your browser.
- Stored procedures: blocks of code with parameters, run with
EXEC. - Triggers: code that fires automatically when a row is inserted, updated or deleted.
This section builds on everything before it: queries, variables and control flow and error handling.