This is a simple stored procedure that adds a new customer to the system. It does so by adding a row to the Customer table with the customer's full name, email and password. It returns the newly added CustomerID as an Out parameter.
Definition:CREATE Procedure CustomerAdd ( @FullName nvarchar(50), @Email nvarchar(50), @Password nvarchar(50), @CustomerID int OUTPUT ) AS INSERT INTO Customers ( FullName, EMailAddress, Password ) VALUES ( @FullName, @Email, @Password ) SELECT @CustomerID = @@IdentityDatabase Tables Used:
Customers: The Customers table keeps track of all customer information in the system. The primary key is CustomerID and we store the users' full name, email address and password. It has a one to many relationship with the Orders table.