Puteti folosi urmatorul script:
DECLARE @myCollation NVARCHAR(4000);
SET @myCollation = N'SQL_Latin1_General_CP1_CI_AS'
SELECT
'ALTER TABLE [' + SO.name + '] ' +
'ALTER COLUMN [' + SC.name + '] ' +
ST.name + '(' + cast(SC.length as varchar) + ') ' +
'COLLATE ' + @myCollation -- SC.collation -- Original collation
+ ' ' +
CASE WHEN SC.isnullable = 1 THEN 'NULL' ELSE 'NOT NULL' END SqlStatement
FROM syscolumns SC
JOIN sysobjects SO ON SO.id = SC.id
JOIN systypes ST ON ST.xtype = SC.xtype
WHERE SC.collation IS NOT NULL
Ca rezultat partial pe Northwind:
ALTER TABLE [Alphabetical list of products] ALTER COLUMN [ProductName] nvarchar(80) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
ALTER TABLE [Alphabetical list of products] ALTER COLUMN [ProductName] sysname(80) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
ALTER TABLE [Alphabetical list of products] ALTER COLUMN [QuantityPerUnit] nvarchar(40) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
...
Cristian Andrei Lefter, SQL Server MVP
MCT, MCSA, MCDBA, MCAD, MCSD .NET,
MCTS, MCITP - Database Administrator SQL Server 2005
http://sqlserver.ro