Web Listing 1: Building the stored procedures use Northwind if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_Orders_DeleteCustOrder]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) drop procedure [dbo].[usp_Orders_DeleteCustOrder] GO if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_Orders_InsertCustOrder]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) drop procedure [dbo].[usp_Orders_InsertCustOrder] GO if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_Orders_SelectCustOrders]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) drop procedure [dbo].[usp_Orders_SelectCustOrders] GO if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_Orders_UpdateCustOrder]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) drop procedure [dbo].[usp_Orders_UpdateCustOrder] GO SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS OFF GO CREATE PROCEDURE usp_Orders_DeleteCustOrder @OrderID int AS DELETE FROM ORDERS WHERE OrderID = @OrderID GO SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS OFF GO CREATE PROCEDURE usp_Orders_InsertCustOrder @CustomerID nchar(5), @RequiredDate datetime, @ShippedDate datetime AS INSERT ORDERS (CustomerID, RequiredDate, ShippedDate) VALUES (@CustomerID, @RequiredDate, @ShippedDate) GO SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS OFF GO CREATE PROCEDURE usp_Orders_SelectCustOrders @CustomerID nchar(5) AS SELECT OrderID, OrderDate, C.CompanyName, C.CustomerID, RequiredDate, ShippedDate FROM Orders as O JOIN CUSTOMERS as C ON C.CustomerID = O.CustomerID WHERE O.CustomerID = @CustomerID ORDER BY OrderID GO SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS OFF GO CREATE PROCEDURE usp_Orders_UpdateCustOrder @OrderID int, @RequiredDate datetime, @ShippedDate datetime AS UPDATE ORDERS SET RequiredDate = @RequiredDate, ShippedDate = @ShippedDate WHERE OrderID = @OrderID GO SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS ON GO