Toolbox

Database job scheduling, Browser Analysis, and More

Scott Mitchell

Contents

Database Job Scheduling Support
In-Depth Browser Analysis
Add Search to Your Web Site

Database Job Scheduling Support

From a developer’s perspective, once a database’s schema has been defined and the tables, stored procedures, and other database objects have been created, it can be forgotten, abstracted away into the data access layer of the application’s architecture. DBAs, however, know that databases require ongoing maintenance. Backups need to be made on a reasonably recurring basis; for heavily loaded servers, statistics need to be manually updated during off-peak hours, and so on. Old data might be moved on a weekly basis from the production database to a reporting database or deleted altogether if no longer needed. Even application-level background tasks may be implemented as jobs at the database level.

Microsoft® SQL Server™ has long offered the SQL Agent tool for defining and scheduling SQL Server jobs. With SQL Agent you can define a job as a series of transact SQL statements, operating system commands, replication commands, and so on, and then schedule the job to run on a schedule and optionally specify whether to notify any operators based on the job’s status. Unfortunately, SQL Agent does not ship with SQL Server 2005 Express Edition. It isn’t designed for large applications, but because it’s free to use and redistribute, it’s often a database of choice for small Web sites and micro-ISVs.

For those companies using the Express Edition or for DBAs in training, Express Agent, from Vale Software, brings SQL Agent-like support to the SQL Server 2005 Express Edition. Express Agent is composed of two applications: Job Builder, a client program for designing and scheduling jobs; and a server program that runs as a service and executes the scheduled jobs, notifying the operator(s) as needed.

Express Agent’s client user interface is quite similar to SQL Agent’s. After connecting to a database, you can review the current jobs (seeing their most recent execution date and status), create new jobs or modify existing ones, and execute existing jobs immediately.

Express Agent doesn’t offer the complete set of options found in SQL Agent. There’s no support for alerts, for example, and some of the available job step features are lacking due to the limited feature set in SQL Server 2005 Express Edition. In addition to the standard job, schedule, and notification support, Express Agent also offers the ability to export and import jobs, and a wizard for scheduling recurring backups.

Express Agent provides a clean, intuitive user experience that closely mimics the experience found in SQL Agent. For those using SQL Server 2005 Express Edition who need job scheduling support, or for database administrators interested in a cost-effective way of exploring job scheduling in SQL Server 2005, check out Express Agent.

Price: $79 for a single user license.

www.valesoftware.com

In-Depth Browser Analysis

The lack of control over the end user’s environment greatly complicates designing Web sites. Visitors to your Web site are likely to have different operating systems, different browsers, different screen resolutions, and different browser settings. A well-designed Web site should be able to determine whether a user’s browser supports the site’s minimum system requirements, and display a message indicating such rather than letting the user interact with a site that was not designed to support their setup.

When a browser requests a Web page, it sends along with the request a User-Agent string identifying the type and version of the browser and the operating system. This User-Agent string can then be examined by the server application to determine the baseline functionality for the particular browser. For example, from the User-Agent string you might determine that a user is visiting with Microsoft Internet Explorer® 5.0 on Windows® XP—a browser that supports cookies and JavaScript.

ASP.NET includes a list of User-Agent strings and their capabilities, which can be programmatically referenced through the Request.Browser property.While the Request.Browser property provides some usefulness, it suffers from two main drawbacks. First, the information that ASP.NET uses that ties a browser’s User-Agent to its baseline capabilities is only updated when a new version of ASP.NET ships. In the meantime Mozilla may have released a new browser, or Internet Explorer 7.0 may have come out of beta, thereby introducing new User-Agent strings that are not fully known by ASP.NET. Second, the browser capabilities in ASP.NET only list the baseline functionality for the browser and do not take into account any settings changes made by the user.

To perform more in-depth browser analysis, you’ll need to turn to a third-party component, such as BrowserHawk 9.0, by cyScape Inc. With just a couple of lines of code, BrowserHawk can determine not only the basic browser capabilities—the browser type, major and minor version, whether it supports JavaScript, and so on—but also more detailed, extended properties, such as whether the user has disabled JavaScript support, the browser’s width and height, the time zone difference between the client and server, whether the user is blocking popups, whether Flash, Acrobat, or other software is installed, and so on.

BrowserHawk uses Browser Definition Files (BDF) that define expressions that match against known User-Agent strings. These files include matches not only for browser User-Agents, but also User-Agents for common search engine spiders. The BrowserHawk Editor makes searching and modifying the BDF list as easy as pointing and clicking. Furthermore, to ensure your BDF information stays up to date, cyScape maintains this information on their server, and BrowserHawk can be configured to periodically download this data.

Other nice features include the ability to log browser details to a database without having to write a lick of code, and being able to determine a visitor’s connection speed and provide more accurate estimates as to how long it will take a user to download a particular file. While BrowserHawk’s gaggle of features is impressive, what’s most pleasing about working with this tool is its ease of use. Installation is a snap, working with the BrowserHawk Editor is intuitive, and determining a visitor’s capabilities can be accomplished with just a short few lines of code. To top it off, BrowserHawk is available for Web sites using classic ASP, ASP.NET, ColdFusion, and JSP.

If you need a foolproof way to determine or log your visitors’ browser capabilities, BrowserHawk may provide the support you’re looking for.

Price: $524 for the professional edition and one year of User-Agent list updates.

www.cyscape.com

Add Search to Your Web Site

As the quantity of content on the Internet has continued to increase exponentially, Web surfers, both novice and experienced, are quick to turn to search engines to find the needle in the haystack. With search becoming an ingrained reflex, it’s increasingly important that Web sites offer their visitors a fast and accurate way to search the site’s content. Without search, you may attract users to your site, but if they can’t find what they’re looking for they’ll turn to Google, MSN®, or Yahoo!, leaving your site in the dust.

Search features can be added to a Web site using any one of a number of techniques. If the bulk of your Web site content is in a database, you can enable full-text indexing and issue the user’s search queries directly against the table. For sites with mainly static, file-based content, Microsoft Index Server may be a viable option. For large, enterprise-level Web sites there are hardware-based solutions, such as Google’s Search Appliance. None of these options, however, are very attractive if you run a small- to medium-sized Web site and don’t have the interest or expertise to configure Index Server or create your own search solution.

Thankfully there are affordable, commercial products like UltimateSearch by Karamasoft that can add search capabilities to your Web site without any database setup, Index Server tuning, or coding. UltimateSearch indexes the directories and file types specified in a configuration file and stores the index both on disk and in memory.

A host of configuration options can be set including specifying files or directories to ignore and words or phrases to omit from the index. This index is automatically refreshed periodically (as specified by a parameter in a configuration file) and can be manually reindexed as well. Furthermore, the indexing performs file system-based scans for static content and crawls HTTP requests for dynamic content. That means your site will be correctly indexed whether it has hundreds of separate Web pages or just a single ASP.NET page that loads different content based on querystring parameters.

In addition to its indexing capabilities, UltimateSearch provides two ASP.NET server controls to assist in integrating the search functionality into your Web site. One control renders a user interface for the search, while the second displays the results. The first provides a bevy of properties for customizing the appearance, including a "suggest" option that, when enabled, displays a dynamic dropdown list of matching search terms that automatically updates as the user enters characters into the search box. There’s also a built-in administration page that lists pages in the index and the indexed terms.

UltimateSearch is clearly designed to be a quick and easy way to add search capabilities to your Web site, and stresses ease of use over in-depth functionality. Adding UltimateSearch to your Web site and adding a site-wide search box can be accomplished in a few seconds, but more involved tasks, such as configuring different index settings for different portions of the Web site or manually modifying the index, are beyond the reach of UltimateSearch.

Price: $249 for a developer license.

www.karamasoft.com

Send your questions and comments for Scott to  toolsmm@microsoft.com.

All prices were confirmed at press time and are subject to change. The opinions expressed in this column are solely those of the author and do not necessarily reflect the opinions of Microsoft.

Scott Mitchell, author of numerous books and founder of 4GuysFromRolla.com, is an MVP who has been working with Microsoft Web technologies since 1998. Scott is an independent consultant, trainer, and writer. Reach him at Mitchell@4guysfromrolla.com or via his blog at ScottOnWriting.NET.