Author: Ben Taylor

Editorials

Fuzzy Comparison

For decades Microsoft SQL Server supports one of the coolest comparison operators available; SOUNDEX. SOUNDEX is used to convert strings into a representative code, allowing words with different spellings to be considered the same. This is very useful in imprecise languages, such as English, having multiple ways to spell the same thing. The way the SOUNDEX function works is that […]

Editorials

The SQL “LIKE” Operator

Today I was discussing with a colleague how we might implement a search against a database containing a table of phrases. We want to allow a user to specify a list of words that may be found in a list of phrases. One search method would determine those records where one or more of the search words were found. Another […]

Editorials

Database Projects vs. Entity Framework Database Migrations

There are two popular Microsoft Technologies used for database migrations that are often considered mutually exclusive. You can use Entity Framework by designing your application code first, and have it create database migrations for your database. You can also use a Database project, and have it generate your database migrations through a database comparison, or even code comparison. These two […]

Editorials

Tuning Entity Framework Queries

Do you ever try to optimize the performance of your Entity Framework queries? If so, there are a couple of things you can do to gain performance without a lot of gymnastics. Having Database Statistics on columns from which you filter result sets can be a big boost, if you are connected to an SQL Server database. Having those statistics […]

Editorials

Creating a Dynamic Where Clause

We’ve considered a number of ways to pass sets of data to an SQL query from a client application. Often those sets are not complex. They may simply be a set of filter options that may be expressed as a series of OR operations. For example, Where LastName = ‘Taylor’ OR LastName = ‘Smith’ This is easy SQL to write. […]

Editorials

Find or Select

I’ve been reading a lot lately about the difference in Entity Framework for finding records based on the primary key. The.Find method has been tuned to locate the record. However, some find better performance using a Linq To SQL query. The difference can be rather dramatic. When using a Linq query a round trip to the database is ALWAYS executed. […]

Editorials

Database Migration Change Script Tips

Today I want to share some tips for writing and maintaining database change or migration scripts. Never assume the state of the target database. If your queries are written in such a way that they can be executed over and over, you will have accomplished this goal. This is helpful so that you don’t have to worry about accidentally running […]

Editorials

Your Scripting Toolbox

If you’ve been around SQL Server, and responsible for keeping it running, it isn’t long until you start to build your own DBA toolbox. Inside your toolbox you maintain scripts designed to predict, detect, and resolve problems for users or the server itself. The scripts come from all over. Some are given to you; some you get from resources you […]

Editorials

A New Twist On Address Storage

Jim writes in about his personal experience with addresses around the world. His story is a great example, representing the unique nature of finding an address. Jim Writes: Ben … I have had to deal with this. It can be difficult for people who are centered in Western countries, or worse, in the US. I can provide a personal example. […]