This stored procedure accepts a CustomerID and returns that customer's Email, Password and CustomerID. Rather than use a single line recordset, CustomerDetail returns the items in individual output parameters. This yields a performance increase.
Definition:CREATE Procedure CustomerDetail ( @CustomerID int, @FullName nvarchar(50) OUTPUT, @Email nvarchar(50) OUTPUT, @Password nvarchar(50) OUTPUT ) AS SELECT @FullName = FullName, @Email = EmailAddress, @Password = Password FROM Customers WHERE CustomerID = @CustomerIDDatabase Tables:
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.