Dick Henderson

Designer ~ Philosopher ~ Poet

Category: SQL

Soundex

From United States Census Bureau

“The Soundex is a coded surname index (using the first letter of the last name and three digits) based on the way a name sounds rather than the way it’s spelled. Surnames that sound the same but are spelled differently – such as Smith and Smyth – have the same code and are filed together. This system was developed to make it easier to find a particular name even though it may have been spelled (or misspelled, as was more often the case) a variety of ways.”

“The decennial census Soundex system began as a project of the Franklin D. Roosevelt Administration’s Works Progress Administration (WPA). Because many states did not have uniform systems for registering births, the Soundex indexes were originally prepared to assist the Census Bureau in finding records for people who needed official proof of age.”

SQL Server has two Soundex related functions.

  • SOUNDEX(String)  returns a four character soundex string
  • DIFFERENCE (StringA, StringB) returns a ranking  0 to 4 with 4 being a perfect soundex match.

Here is an excellent post on this subject:

Do You Know Soundex Functions

Life is Guid

“Each GUID is like a beautiful snowflake: every one a unique item waiting to be born.”

Those are the most beautiful words I have ever know anyone to write about a data type.  I bet no has ever had that passion for an Integer.

The words come from an excellent post on CodingHorror.com

Primary Keys: IDs versus GUIDs

and by the way . . .

A DotNet Framework GUID is a sql  UNIQUEIDENTIFIER.  

Thanks again Microsoft.

 

 

Data Type Mapping

SQL Server and the .NET Framework are based on different type systems.”

I am still thinking about that dime I lost using sql REAL data type.

Sql REAL is equivalent to a DotNet Frame work single.

Sql FLOAT is equivalent to a DotNet Frame work double.

Why did they do this?

Here is a complete list:

SQL Server Data Type  Mappings

 

Float vs. Real

SQL Data Types

What is the difference between a FLOAT and a REAL?   Last week, It was ten cents ($0.10) on $2.3 million dollar budget account.

Both FLOAT and REAL are approximate number data types.  FLOAT storage size is 8 bytes.  REAL storage size is 4 bytes.

I used REAL as a return type in a stored procedure.  The difference in precision cause the two reports not to match.

Looking Back

I should not have used either of these approximate number data types.   I think DECIMAL(18,2) would have been a better choice.

© 2019 Dick Henderson

Theme by Anders NorenUp ↑