Click here to Skip to main content
15,896,154 members
Articles / Database Development / SQL Server / SQL Server 2008

Configuring SQL Server Accent-Insensitivity

Rate me:
Please Sign up or sign in to vote.
5.00/5 (9 votes)
21 Feb 2012CPOL7 min read 58K   389   9  
This article describes the steps to re-configure SQL Server so that queries return accent-insensitive results. It includes source code (using Microsoft SQL Server 2008 R2 Shared Management Objects) to automate some of the steps in this procedure.
using System;

using Microsoft.SqlServer.Management.Sdk.Sfc;

namespace Siphon
{
    /// <summary>
    /// A key concept in using the SMO object library is the Unique Resource Name (URN). The URN uses a syntax similar 
    /// to XPath. The XPath is a hierarchy path used to specify an object in which each level has qualifiers and 
    /// functions. In SMO the URN has two elements: the path and attribute naming that has limited functionality. The 
    /// path is used to specify the location of the object whereas the attribute naming allows for a degree of 
    /// filtering. An example of an URN for a database synonym is:
    /// Server[@Name='SOL']/Database[@Name='ix_nm_extensions']/Synonym[@Name='Lookups_Values' and @Schema='c']
    /// </summary>
    public class UrnHelper
    {
        static public String GetSchema(String urnText)
        {
            Urn urn = new Urn(urnText);
            return urn.GetAttribute("Schema") ?? String.Empty;
        }

        internal static string GetName(Urn urnText)
        {
            Urn urn = new Urn(urnText);
            return urn.GetAttribute("Name");
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Chief Technology Officer Shift iQ
Canada Canada
I have been building software systems for more than 20 years, working for organizations that range from small non-profit associations in my local community to global Fortune 500 enterprises.

I specialize in the design and implementation of online database solutions. My work-related research interests include software design patterns and information architecture.

Comments and Discussions