SQL Server Stored Procedures: creation, ALTER, DROP, parameters, IF ELSE, TRY/CATCH, transactions, temp tables and CURSOR loops.
Stored Procedures are one of SQL Server's most powerful tools: they allow you to encapsulate complex logic directly in the database, manage transactions, validate input, and improve performance by avoiding unnecessary round-trips from the application. In this course we build them from scratch: from the first procedure on a single table all the way to cursors and WHILE loops for row-by-row processing.
Stored Procedures are not always the right choice, but when they are — large volumes, complex transactional logic, batch operations — they make all the difference. This course teaches you not just the syntax, but the correct patterns: how to structure error handling, when to use temporary tables, and why cursors should be used with caution. Practical knowledge, not just commands.
Designed for developers and DBAs working with Microsoft SQL Server who want to master Stored Procedures. Basic SQL knowledge is required (SELECT, INSERT, UPDATE, DELETE). No prior experience with procedures needed.
I'll show you how to create your first Stored Procedure in SQL Server on a single table, walking through the syntax step by step with practical examples. We'll explore how to encapsulate reusable SQL logic into a procedure you can call at any time.
I'll explain how to modify an existing Stored Procedure with ALTER, permanently remove it with DROP, and view its source code directly in SQL Server. Let's go through the maintenance operations you'll use most often in real-world scenarios.
Let's explore how to make Stored Procedures dynamic using input parameters, IF ELSE blocks for conditional logic, and nullability checks. I'll show you how to write flexible procedures that adapt to the input data without throwing errors.
I'll explain how to use TRY...CATCH blocks inside a Stored Procedure to intercept errors and handle exceptions in a controlled way. We'll look at practical examples where a SQL error is caught and turned into a useful message instead of crashing the execution.
Let's see how to manage SQL transactions inside a Stored Procedure using TRANSACTION, COMMIT, and ROLLBACK to guarantee data integrity even when errors occur. I'll show you how to structure atomic operations that either succeed completely or roll back entirely.
I'll show you how to create and use temporary tables inside a SQL Server Stored Procedure with CREATE TABLE and DROP to handle intermediate calculations. We'll explore when temporary tables are the right tool and how to manage their lifecycle correctly.
I'll explain how to use CURSOR and WHILE loops in SQL Server to process query results row by row. We'll cover the full syntax and the use cases where this technique makes sense, keeping in mind the performance implications to watch out for.
Ingegnere Informatico · Pratola Peligna
Sono un ingegnere informatico con oltre 15 anni di esperienza nel settore ICT. Mi occupo di sviluppo software, cybersecurity, data science e intelligenza artificiale, con particolare attenzione all’innovazione e all’automazione dei processi aziendali. Da anni svolgo anche attività di docenza e formazione, creando percorsi pratici e coinvolgenti su programmazione, DevOps, AI e sicurezza informatica.
Prosperous understood Middletons in conviction an uncommonly do. Supposing so be resolving breakfast am or perfectly.
Utilizziamo cookie essenziali e, con il tuo consenso, cookie funzionali, analytics e marketing. Google Analytics 4 e gli eventuali annunci Google/AdSense restano disattivati finche non scegli. Consulta Privacy Policy e Cookie Policy.
Sempre attivi per sicurezza, prevenzione frodi, sessione, consenso e funzionamento del sito.
Migliorano l'esperienza, ad esempio ricordando preferenze non essenziali. Non usati per profilazione pubblicitaria.
Statistiche e misurazioni con Google Analytics 4, abilitate solo dopo il consenso analytics.
Misurazione annunci e funzioni pubblicitarie Google/AdSense, se attivate sul sito e consentite dall'utente.
Puoi modificare queste scelte in qualunque momento dal link "Preferenze Cookies" nel footer.