CLR User-Defined Functions in C#

In this article we will continue investigating User-Defined Functions in SQL Server. As before, we will look at functions that aid in determining the proximity of ZIP codes to a given coordinate. While as we’ve previously demonstrated these functions can be implemented entirely in T-SQL, that may not always be viable. Let’s assume that you need to leverage functions not present in T-SQL or perhaps you’re simply more comfortable with .NET than T-SQL, then one of your options is to implement the User-Defined Functions in C#.
Continue reading

Posted in .NET, SQL Server | Leave a comment

Implementing Zip Code Proximity Functions in MS SQL Server

This post is in the continuing series of articles on database functions, stored procedures, and implementing ZIP code proximity functionality.

Recently I had the opportunity to work on a project involving SQL Server. Having focused mostly on open source databases, I decided to brush up on SQL Server by going through the exercise of implementing the ZIP code proximity functions in T-SQL. The following User-Defined Functions (UDF) were developed and tested in SQL Server 2008 R2 Express, but should be compatible with older versions of SQL Server as well.
Continue reading

Posted in SQL Server | 3 Comments

How to selectively statically compile and link *nix binaries

Recently I needed to compile a binary to place on an embedded system. The catch is the binary depended on a newer version of a library than existed on the target system. In order to make the fewest changes possible on my target system, I needed a way to statically link the newer library without the bloat of statically compiling the entire binary.

The following explores a simple example of statically linking specific libraries, it was tested on FreeBSD but should apply to Linux, BSD, or any other system using gcc.
Continue reading

Posted in BSD, gcc, Linux | Leave a comment