There you have it: a complete advertising banner system with source code. If it isn't exactly what you want, get in there and make the changes you need. And it might even be just what you need without modifications.
In this chapter, you've learned several important things. One is how to maintain statistics in a database. The important statistics are the Clicks/ClicksLimit and Views/VewLimit fields.
Another very important thing you saw was how to perform some fairly complex calculations in a stored procedure. This was done in the sp_GetNextAd stored procedure because the weights of all advertisements are considered for selecting the next advertisement.
The last important thing talked about was creating an NT Service. The NT Service that was created for this application sends out e-mails with statistics for the advertisements.