Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Learn Advanced T-SQL For SQL Server Administrator
Rating: 4.6 out of 5(1,060 ratings)
6,706 students

Learn Advanced T-SQL For SQL Server Administrator

Getting to understand stored procedures
Created byRaphael Asghar
Last updated 4/2017
English
English [Auto],Italian [Auto],

What you'll learn

  • The student will learn about stored procedures, If Else, While Loop, cursors, derived tables, CTEs, sproc permissions, temp tables, sproc parameters and much more. The student at the end of this course will gain valuable information about sprocs and how to read and follow them in the production environment.

Course content

1 section34 lectures5h 15m total length
  • Table of contents7:19

    Master stored procedures to drive server-side processing in SQL Server databases, covering parameters, variables, control flow, error handling, and reading and applying SQL blocks.

  • 1 Download all software needed10:54

    Download VirtualBox, Windows Server, and SQL Server 2014 to set up a self-contained lab for advanced T-SQL training; learn download steps, trial options, and prerequisites before installation.

  • 2 Installing Windows Server OS13:37

    Install VirtualBox, create a 64-bit Windows server virtual machine with desktop experience, allocate memory and disk space, and boot from an iso to install the operating system.

  • 3 Shared folders6:34

    Set up a shared folder between the host and the virtual machine to centralize SQL 2014 scripts and course materials, then access and run them directly in the VM.

  • 3a Installing SQL 201418:15

    Install SQL Server 2014 on a virtual machine by extracting the ISO with WinISO, mounting it via a shared folder, and completing a guided setup with default features.

  • 4 Installing Adventureworks database4:57

    Install and configure Adventureworks 2014 for SQL Server by downloading, extracting, moving to the C drive, and restoring the backup in a virtual machine.

  • 5 What is a Stored Procedures15:35

    Learn what a stored procedure is and how to create it with create procedure or create proc. Identify system procedures with sp_ prefix and adopt a usp_ naming convention.

  • 6 Modifying and deleting a sproc4:06

    Discover how to modify and delete stored procedures in SQL Server using alter and drop, with both GUI and script approaches, and understand basic management of sprocs.

  • 7 Using a single input parameter7:14

    Create and use a single parameter in a stored procedure to filter data and return a limited result set, with examples using category names and inner joins.

  • 8 Multiple parameters6:48

    Learn how to use multiple parameters in a stored procedure to filter by category and subcategory, manage parameter order, and name parameters to ensure the where clause works.

  • 9 Blocks multiple sql statements6:34

    Learn to group multiple sql statements in a single stored procedure using begin and end blocks, with indentation and comments, and understand control of flow keywords while executing and reading.

  • 10 what is a variable11:42

    Learn how variables empower stored procedures by declaring and setting int and varchar data types, and using them with like and where clauses in control flow.

  • 11 Demo of Sproc using update.12:07

    Learn how to use a stored procedure to update multiple related tables in a production sql environment, propagating allergy data across admissions, surgery, medication, and history while ensuring data integrity.

  • 12 Demo of Sproc Insert, Print, IF Else and Set Nocount on14:13

    Demonstrates creating and using stored procedures with insert, print, if else, and set nocount on in a production SQL context. Includes testing with a students table.

  • 13 Demo of IF Else11:31

    Explore the if and else logic in T-SQL, driven by boolean conditions that execute code blocks. See examples of variable declarations, comparisons, and update or insert decisions.

  • 14 Reading a nested if else statement12:45

    Explore nested if-else logic in t-sql: declare variables, begin-end blocks, and print statements, with practical examples reading stored procedures in Adventureworks databases.

  • 15 While loop11:14

    Explore how the SQL while loop repeats a block while a condition is true, and learn how break and continue control flow to prevent endless loops and read stored procedures.

  • 16 Cursors13:59

    Explore how cursors process result sets row by row in T-SQL, compare production performance with set-based queries, and learn how to declare, fetch, and deallocate cursors.

  • 17 Transactions8:58

    Begin transaction, commit, and rollback to safely control updates and deletes, and see how updating without a where clause can lead to data corruption.

  • 18 Error handling14:13

    Explore error handling with the SQL Server try catch block, including begin try, begin catch, error functions, and transaction integration to capture and respond to errors.

  • 19 Table variables9:09

    Explore table variables, containers for temporary data used in stored procedures, created with declare and @ prefix, and compare them to temp tables to decide when to use each.

  • 20 Derived tables6:06

    Explore derived tables that pull data from existing tables for fast on-the-fly results. Name the derived table and place a select inside parentheses to filter data.

  • 21 Views8:56

    Discover how to create a view from a multi-table select to make a reusable, virtual table. Use aggregates and case statements with views to simplify analysis of sales totals.

  • 22 Excel formula5:21

    Discover an Excel formula to create a quoted in-clause list for SQL queries, enabling efficient filtering of sales order numbers in production environments.

  • 23 Intro to CTE11:06

    Explore sql common table expressions (cte) as memory-resident, temporary data containers within a query, enabling select, insert, delete, and update operations without creating physical tables.

  • 24 Multiple CTEs5:15

    Master creating and joining multiple CTEs in T-SQL by separating them with commas, aliasing each CTE, and querying joined results filtered by department, including example with group department CTE.

  • 25 Aggregate cte4:47

    Apply aggregates to a CTE to compute total hours by gender using sum and group by. Learn the three CTE steps, separate multiple CTEs with semicolons, and verify results.

  • 26 Insert delete Update CTE7:25

    Learn to use a common table expression to insert, update, and delete data in SQL Server, with a backup, and a parameterized stored procedure.

  • 27 CTE and sproc5:16

    Create and alter a stored procedure using a common table expression (cte), add a last name parameter, and apply a where clause to filter results.

  • 28 Recursive CTE8:32

    Explore how a recursive cte references itself to unravel hierarchical data, determining each employee's level and managers in a company example, using anchor and recursive members with union all.

  • 29 vlookup8:07

    Learn to perform vlookup in excel to populate product descriptions from a lookup table, using product IDs, defining a named range, and choosing exact match for precise results.

  • 30 reviewing sprocs7:48

    Develop the ability to read and decipher stored procedures, identify begin and end blocks, CTEs and recursive CTEs, and understand error handling and transactions.

  • 31 Stored Procedure permissions10:58

    Apply permissions to stored procedures to micro-manage access to specific table columns, granting execute rights to users and revoking them to control data visibility.

  • 32 What is Power BI3:55

    Learn Power BI fundamentals by downloading Power BI Desktop, designing reports and dashboards, and setting permissions for sharing. Publish dashboards via Power BI services for enterprise-wide access and insights.

Requirements

  • Before taking this course, you must take the prerequisite Learn T-SQL from Scratch. While not mandatory, you should take the FREE Ultimate in Becoming a SQL DBA course as this will help you set up the environment.

Description

The student will learn about stored procedures, If Else, While Loop, cursors, derived tables, CTEs, sproc permissions, temp tables, sproc parameters and much more.  The student at the end of this course will gain valuable information about sprocs and how to read and follow them in the production environment.  In addition, the student will be given examples of block statements, transactions commands, recursive CTEs, error handling, variables, and much more.  This course will greatly help those students that want to understand how to read, modify, and execute from simple to complex stored procedures.  By creating stored procedures, the developer has greater control in the execution of SQL commands, permissions, and greater flexibility in updating the sproc.

Who this course is for:

  • Any student who want to learn about advanced SQL commands and want to understand development in a little more detail