o.name as TableName
, c.Name as ColumnName
, t.name as Columntype
, c.max_length as ColumnSize
, c.collation_name as CurrentCollation -- if null = default collation of the database
, 'ALTER TABLE ' + O.NAME + ' ALTER COLUMN ' + C.NAME + ' ' + T.NAME + '(' + CONVERT(VARCHAR(100), c.max_length) + ') COLLATE SQL_Latin1_General_CP1_CI_AI'
INNER JOIN sys.columns c
on o.object_id = c.object_id
INNER JOIN sys.types t
on t.system_type_id = c.system_type_id
o.TYPE = 'U'
and t.name like '%CHAR%'
Open in new window
Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.