Archive for July, 2009

T-SQL: Change Collation on your LIKE Clause Using COLLATE

Friday, July 24th, 2009

Ever have trouble matching unicode letter equivalents in your T-SQL queries? For example, when you want “Québec” and “Quebec” to be equivalent in your text search query?

This is where specifying Accent Insensative Collation (The “AI” in all those collation codes) comes to the rescue.  If your database is already set to an AI collation, then you are all set already, but if not, change your LIKE statement to use something like the following:

SELECT *
FROM MyTable (NOLOCK)
WHERE MyColumn COLLATE SQL_Latin1_General_CP1_CI_AI LIKE '%quebec%'

Hope this helps!

August 2009 IT Toolbox Column for TechNet Magazine

Friday, July 24th, 2009

The August 2009 issue of TechNet Magazine is out on the website. Check out my IT Toolbox column here:

August 2009 TechNet Magazine IT Toolbox

In this issue I covered:

  • Notepad++: Replace Your Text-File Editor

Check it out and let me know what you think!

And if you have a tool you want to see me review, suggest it to me: tntools@microsoft.com.