SQL Procedure holding year variable


Create Procedure ProcessA

(@expiration int)
AS


SELECT c.FirstName, c.LastName, v.expirationofpolicy_yr, v.Make, v.Model
FROM Customer As c
JOIN Vehicle As v
ON c.CustomerID = v.CustomerID
WHERE v.expirationofpolicy_yr = @expiration
ORDER BY c.LastName, c.FirstName, v.expirationofpolicy_yr

----------------------------------------------------
EXECUTE ProcessA 2010
Business reason for running the simple procedure above– I want to know every single policy in 2010 and compare it with a couple other reporting systems to verify that various communications have been sent out.  This procedure would have been written as a stop-gap until the remainder of the steps could be added. 

No comments:

Post a Comment