bugl
bugl
HomeLearnPatternsSearch
HomeLearnPatternsSearch

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

SQL CREATE PROCEDURE Keyword

Concept visual

SQL CREATE PROCEDURE Keyword

Pointer walk
two pointers
leftright102132436485116
left=0
right=6
1
3

Start at both ends

CREATE PROCEDURE Keyword

Previous

❮ SQL Keywords

Next

Create Procedure

The CREATE PROCEDURE

command is used to create a stored procedure. A stored procedure is a prepared SQL code that you can save, so the code can be reused over and over again. The following SQL creates a stored procedure named "SelectAllCustomers" that selects all records from the "Customers" table:

Example

CREATE PROCEDURE SelectAllCustomers

AS

SELECT * FROM Customers
GO;

Execute the stored procedure above as follows:

Example

EXEC SelectAllCustomers;

Previous

❮ SQL Keywords

Next

Previous

SQL PRIMARY KEY Keyword

Next

SQL RIGHT JOIN Keyword