Transact-SQL Implement Stored Procedure
CREATE PROCEDURE GetOrders
@regionid int
AS

SELECT b.RegionDescription, a.*
FROM Orders a, Region b
WHERE a.RegionID = b.RegionID 
	AND a.RegionID = @regionid
Listing 3 This Transact-SQL statement from the data services tier contains the code necessary to implement the stored procedure GetOrders on SQL Server. Note that the region ID is passed in from the ActiveX DLL.