Intersoft Development, Inc. Home Link
If you are currently using SQL-Server for your business applications, are you sure you are realizing its full potential? SQL 2000 and 2005 are quite powerful, and now SQL Server 2008 extends this power...
Read More...
Intersoft Development emphatically recommends CodeGear Delphi for custom software development! With the newest Embarcadero Delphi 2010 release, Delphi continues its tradition of providing industry-leading unmatched software development capabilities in this RAD programming language and IDE.

Delphi 2010 builds upon the already excellent features and capabilities of Delphi 2009 by adding touch/gesturing support to recent Delphi language enhancements for Generics, Closures / Anonymous-Methods, Unicode, and much more...
Read More...
CEO's Blog Topics Below
Recent Blog Topics:
Looking for affordable professional 2D/3D CAD Software? VariCAD is a full-featured comprehensive 2D/3D CAD package offering:
  • Windows / Linux support
  • 3D modeling with automatic export 2D.
  • Sizing of mechanical components.
  • Plus, predefined library of commnon parts.
  • Quick and intuitive 3D/2D GUI
  • Compatibility with DWG, DXF, IGES, STEP and STL...

FREE 3D CAD Software Trial and Sale - VariCAD

Free Software, Source Code, and Best-Practice Documentation Index from your
Cleveland Software, Database, Web Design, Consulting, and SQL / Delphi Experts

SQL Server - User Defined Function:
Nullable Integer Column Comparison

Compares two Nullable Integer Values, and returns ONE (1) if the column values are the same (including NULL = NULL), otherwise returns ZERO.

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[udfNullableIntegerCompare]') and xtype in (N'FN', N'IF', N'TF'))
drop function [dbo].[udfNullableIntegerCompare]
GO

CREATE FUNCTION udfNullableIntegerCompare 
	(@iInteger1	INT,
	 @iInteger2	INT )
RETURNS BIT
AS
BEGIN

--If the expression returns ZERO, the column values are not equal, otherwise, if it returns ONE, the column values are equal.
-- We then use a case statement to flip the value. 
RETURN (CASE
		WHEN (@iInteger1 IS NULL AND @iInteger2 IS NOT NULL) OR (@iInteger2 IS NULL AND @iInteger1 IS NOT NULL) THEN 0
		ELSE ( 1 - ABS( SIGN( ISNULL( @iInteger1, 0 ) - ISNULL( @iInteger2, 0) ) ) )
	END)

END
 
.NET framework version: 2.0.50727.3615