"AddUser" Stored Procedure

Description:

This stored procedure adds a new user to the database. The input parameters include Name, Email and Password.

Definition:
    
   CREATE PROCEDURE Portal_AddUser
   (
       @Name     nvarchar(50),
       @Email    nvarchar(100),
       @Password nvarchar(50),
       @UserID   int OUTPUT
   )
   AS
   
   INSERT INTO Portal_Users
   (
       Name,
       Email,
       Password
   )
   
   VALUES
   (
       @Name,
       @Email,
       @Password
   )
   
   SELECT
       @UserID = @@Identity
        
Database Tables Used:

Users:  Each record in the Users table is a unique user identity. The primary key in this table is the UserID identity field.