SELECT 'ALTER TABLE '+A.name+' ALTER COLUMN '+B.name+
CASE WHEN B.xusertype = 231 THEN ' nvarchar' WHEN B.xusertype = 175 THEN ' char' END+' ('+
convert(varchar,B.prec)+') COLLATE Chinese_Taiwan_Stroke_BIN '+
CASE WHEN B.isnullable=1 THEN 'NULL' ELSE 'NOT NULL' END
FROM dbo.sysobjects A
INNER JOIN dbo.syscolumns B ON B.id=A.id
WHERE A.type='U' AND B.collation='Chinese_Taiwan_Stroke_CS_AS'
ORDER BY A.name
CASE WHEN B.xusertype = 231 THEN ' nvarchar' WHEN B.xusertype = 175 THEN ' char' END+' ('+
convert(varchar,B.prec)+') COLLATE Chinese_Taiwan_Stroke_BIN '+
CASE WHEN B.isnullable=1 THEN 'NULL' ELSE 'NOT NULL' END
FROM dbo.sysobjects A
INNER JOIN dbo.syscolumns B ON B.id=A.id
WHERE A.type='U' AND B.collation='Chinese_Taiwan_Stroke_CS_AS'
ORDER BY A.name
注意:KEY值欄位得先把索引移除,改完後再加回
定序:
Chinese_Taiwan_Stroke_CS_AS (繁體中文區分大小寫)
Chinese_Taiwan_Stroke_CI_AS (繁體中文不分大小寫)
全站熱搜
留言列表