"usp_CustomerAddSurvey" Stored Procedure

Description:

This is a simple stored procedure that takes a customer id, and an XML document as a string and stores it into the Demographics column of the appropriate row in the Individual table. This XML document must conform to the individual survey schema defined by the AdventureWorks database.

Definition:
CREATE PROCEDURE usp_CustomerAddSurvey
(
	@CustomerID int,
	@CustomerSurvey nvarchar(2048)
)
WITH EXECUTE AS OWNER
AS

UPDATE Sales.Individual
-- Find the five most common additional products purchased along with a given product.
SET Demographics = @CustomerSurvey
WHERE CustomerID = @CustomerID;

Database Tables Used:

Individual:  The Individual table keeps track of retail customers. It contains the link between the Customer table and the Contact table for people who buy products on the web site.