Database Case-Sensitivity and Connecting to an External Case Sensitive Database

1 minute read time.

If you are working with SQL Server you may have read in the System Administration guide that when installing Sage CRM the SQL server main install needs to have a case insensitive collation. A binary collation, or a case sensitive collation, is not supported for installation.

Within the Custom_SysParams table you can find the row that contains "CaseSensitive".

parm_name = 'CaseSensitive'
parm_value = 'N'

If parm_value is set to Y, this turns Case Sensitivity on and a lowercase(colname) is no longer done
around the colnames. Note that, in order to stop this affecting other areas of the system,
ConvertToLowercase.sql must be run. This renames the columns in the CRM database to be
lowercase.

You can find ConvertToLowercase.sql here:

C:\Program Files\Sage\CRM\CRM\Setup\SQLServer\Upgrade\ConvertToLowercase.sql

NOTE: BUT, BUT - please work with a case insensitive database and save yourself trouble. That is the way that Sage CRM is designed to work.

Working with a Case Sensitive External Database

This tip comes from my colleagues in Switzerland.

If you have a need to connect to a case-sensitive external database then a very good trick is to create a view that uses a fully qualified reference to that table.

[code language="sql"]
CREATE VIEW cSuppliers AS
SELECT
CompanyName as companyname,
ContactName as contactname
FROM northwind..suppliers
[/code]

You can see above that all the field names have been aliased to lowercase. Once you have done this you can connect into the database in crm and connect to the table with the view.

This gets round the problem that Sage CRM doesn't support case sensitive tables and fields.