Configuring Your Microsoft SQL Server Database for Accent Insensitive Search.

July 27, 2009 | KB: 1012272
Laserfiche Server - Team (MSDE) 8.1, Laserfiche Server - United (MS SQL) 8.1

Summary

By default, Laserfiche 8.1 is not configured for accent insensitive searches for entry names and string field values. You can modify this behavior by configuring your Microsoft SQL Server database to use an accent insensitive collation. Laserfiche 8.1 requires a case insensitive collation, but within the list of available case insensitive collations, you can choose to use an accent insensitive collation.

There are two methods for configuring a database to use an accent insensitive collation:

  • Create a new database that uses an accent insensitive collation.
  • Modify specific columns in an existing database to use an accent insensitive collation.

More Information

If you already have an existing Laserfiche 8.1 database, see the following sample SQL scripts for details on how to set entry names and string field values to use an accent insensitive collation.

Important: Make sure you have a valid backup of your SQL database prior to running the following scripts.

Note: Make sure the Laserfiche Server is not running prior to running the following scripts.

Sample script for configuring entry names to be accent insensitive

ALTER TABLE toc DROP CONSTRAINT toc_name_ck
ALTER TABLE toc DROP CONSTRAINT toc_unq

-- The Latin1_General_CI_AI collation is provided as an example.
-- Other case insensitive, accent insensitive collations could be used instead.
ALTER TABLE toc ALTER COLUMN name NVARCHAR(255)
  COLLATE Latin1_General_CI_AI NOT NULL

ALTER TABLE toc ADD CONSTRAINT toc_name_ck CHECK (name <> N'')
ALTER TABLE toc ADD CONSTRAINT toc_unq UNIQUE (parentid, name)

Sample script for making string field values accent insensitive

-- The DROP INDEX statement may fail, but this can be ignored.
DROP INDEX propval_str_val_ix ON propval

-- The Latin1_General_CI_AI collation is provided as an example.
-- Other case insensitive, accent insensitive collations could be used instead.
ALTER TABLE propval ALTER COLUMN str_val NVARCHAR(4000)
  COLLATE Latin1_General_CI_AI NULL

-- This command will recreate the index on the propval.str_val column,
-- and so could take a long time if the propval table is large.
CREATE INDEX propval_str_val_ix ON propval (prop_id, tocid) INCLUDE (str_val)