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... - Наука
thank you, simple explanation with straightforward examples ( I wish there were one advanced example)
Thanks!
Good structured Video and informative content 💪
Glad you liked it!
Very well explained
Thanks!
Concise, thanks :)
You’re welcome!
Well done on this video, please I need your tutorial on how to use the Stored procedure for the validation of input parameters
Thanks! You can use techniques such as if statements or case statements inside the stored procedures to validate the parameters
❤
Thanks!
🥰🥰
Thanks!
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;
Is there a question you have about this code?
@@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.