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;
Want to easily remember the SQL commands for your database? Get my free SQL Cheat Sheets here: www.databasestar.com/get-sql-cheat-sheets/?
thank you, simple explanation with straightforward examples ( I wish there were one advanced example)
Thanks!
Very clear examples, thanks for the video! You provided the exact info what I was looking for!
Glad it was helpful!
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
This video is very helpful. Thanks for sharing this.
Glad you like it!
Good structured Video and informative content 💪
Glad you liked it!
thanks that was a really good explanation!!😉
You’re welcome!
Very well explained
Thanks!
Concise, thanks :)
You’re welcome!
❤
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.