SQL Server Stored Procedure - How To

Поделиться
HTML-код
  • Опубликовано: 5 июл 2024
  • 📝 Get my free SQL Cheat Sheets: www.databasestar.com/get-sql-...
    🎓 Learn how to write and read SQL Server Stored Procedures: databasestar.mykajabi.com/ess...
    Stored procedures are a helpful feature of SQL Server.
    In this video, you'll learn:
    - what they are
    - when and why to use them
    - some simple examples of using stored procedures to select, insert, update, and delete data
    ⏱ TIMESTAMPS:
    00:00 - Intro and setup
    01:08 - Select stored procedure
    03:04 - Insert stored procedure
    06:41 - Update stored procedure
    08:26 - Delete stored procedure
    🔗 VIDEO LINKS:
    GitHub script for SQL Server: github.com/bbrumm/databasesta...
  • НаукаНаука

Комментарии • 17

  • @colourNika
    @colourNika 10 месяцев назад +1

    thank you, simple explanation with straightforward examples ( I wish there were one advanced example)

  • @Impergator-ld5gi
    @Impergator-ld5gi Год назад +1

    Good structured Video and informative content 💪

  • @mezomezo8718
    @mezomezo8718 Год назад

    Very well explained

  • @user-yw4jg9tz2l
    @user-yw4jg9tz2l 2 месяца назад

    Concise, thanks :)

  • @user-zv8sb1en9x
    @user-zv8sb1en9x Год назад

    Well done on this video, please I need your tutorial on how to use the Stored procedure for the validation of input parameters

    • @DatabaseStar
      @DatabaseStar  Год назад

      Thanks! You can use techniques such as if statements or case statements inside the stored procedures to validate the parameters

  • @kimleng539
    @kimleng539 2 месяца назад

  • @anujamahagamage1316
    @anujamahagamage1316 Месяц назад

    🥰🥰

  • @kvelez
    @kvelez 29 дней назад

    CREATE PROCEDURE SelectCustomers
    AS
    SELECT *
    FROM Customer;
    =====
    CREATE PROCEDURE InsertCustomer
    @customer_name NVARCHAR (50), @customer_status INT=1
    AS
    INSERT INTO Customer
    VALUES (@customer_name, @customer_status);
    =====
    CREATE PROCEDURE UpdateCustomer
    @newName NVARCHAR (50), @newActive INT, @customerId INT
    AS
    UPDATE Customer
    SET Name = @newName,
    is_active = @newActive
    WHERE Id = @customerId;
    ====
    CREATE PROCEDURE DeleteCustomer
    @customerId INT
    AS
    DELETE Customer
    WHERE Id = @customerId;

    • @DatabaseStar
      @DatabaseStar  29 дней назад +1

      Is there a question you have about this code?

    • @kvelez
      @kvelez 29 дней назад

      @@DatabaseStar I wanted to share it with others so that they can use it.
      **But if you can do a followup on procedures, I would enjoy it.