January 30, 2003

Eliminating IsEmpty and IsNull Issues in ASP

When dealing with COM, unfamiliar database schemas, or regular code, sometimes you will find yourself wondering whether to test if a variable is Null by using either: IsEmpty(varname)IsNull(varName)If varname = 0If varname 0, orIf varname > 0 This little quick trick will eliminate all of those issues and allow you

Creating UNIQUE and PRIMARY KEY Constraints on Computed Columns

Defining a UNIQUE constraint on a computed column is a straightforward process, as the following example shows: CREATE TABLE T1 (col1 int NOT NULL,col2 AS col1 + 1 UNIQUE) However, if you define a PRIMARY KEY on a computed column, such as: CREATE TABLE T2 (col1 int NOT NULL,col2 AS

Multiply Values of a Particular Column in SQL Server

There is no T-SQL function for getting product of rows in a particular column. For example, say you had a table like this: –/////////////////////////////select * from #tbltest order by mydate ascID MyDate Value1 1/1/99 102 1/1/99 203 1/1/99 304 2/1/99 405 2/1/99 50–///////////////////////////// If you want to get product of

Workaround for the Lack of MSVC++ Template Support

I’ve been bitten by MSVC++’s inability to have templated methods without the whole class being templated and today I figured out a workaround that allows you to maintain most of the elegant design and still compiles under MSVC++.Often, templated members are used to provide default implementation for pure virtual functions.

Handling Release-only Bugs

Sometimes a program crashes or simply misbehaves on release builds. This is very frustrating because usually you have to ship the optimized release version. The most common reason for this phenomenon is that some code is executed in _DEBUG mode only. This can happen if you place some important code

Using Finally for I/O And SQL

An application’s memory footprint grows over time and may eventually cause the application to crash. There are many things that lead to a slow memory burn. One of these is failure to close file handles and SQL database connections. File file = new File(…);try {FileInputStream fis = new FileInputStream( file

Enterprise Application Integration: The Problem that Won’t Go Away

Burlingame, CA?Mergers and acquisitions happen. IT environments expand as new applications are added to keep pace with business goals. New technologies spring up, as others that were once the latest, greatest thing become yesterday’s news. Change is inevitable in the application development field, but one issue that remains constant throughout

Use Hidden Fields to Load JSP-based Web Pages Dynamically

Say you need to change the look and feel of a JSP page being loaded, depending upon the calling URL. You can use hidden form fields to determine the look and feel of the page being loaded. Suppose you’ve got three pages called one.jsp, two.jsp, and three.jsp. Pages one.jsp and

Learn the Eight Principles of Web Services Management

eb services are more complex to deploy than Web sites or intranet applications. They are based on intricate platforms, or runtime environments that, like any software, can have their own runtime errors. It simply isn’t safe to assume that a debugged Web service will remain running properly without mechanisms to