SQL Script To Locate Columns With Different Collation

A while ago I posted about a problem with a collation conflict on a couple of columns in the Tax table. It seems I posted about how to fix the problem, but it seems I didn’t post how I found the problem columns.

I did this with a fairly simple SQL script:

DECLARE @Collation SYSNAME SET @Collation = 'SQL_Latin1_General_CP1_CI_AS'

SELECT
   TABLE_NAME AS 'Table'
   ,COLUMN_NAME AS 'Column'
   ,DATA_TYPE AS 'Data Type'
   ,COLLATION_NAME AS 'Collation Name'
FROM
   INFORMATION_SCHEMA.COLUMNS
WHERE
   DATA_TYPE IN ('varchar','char','nvarchar','nchar','text','ntext')
AND
   COLLATION_NAME <> @Collation

Collation Conflict Printing The Tax Detail Report

Microsoft Dynamics GPWe upgraded a client from Microsoft Dynamics GP 9 to Microsoft Dynamics GP 2010 recently, and the first time they tried to run the VAT 100 report they received a number of errors:

Microsoft Dynamics GP - An error occurred executing SQL statements.Microsoft Dynamics GP – An error occurred executing SQL statements.

Continue reading “Collation Conflict Printing The Tax Detail Report”