Change field collation

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Jeroen (PingMe_at_NG.com)
Date: 07/15/04


Date: Thu, 15 Jul 2004 16:29:37 +0200

Hi,

is there a way to change the collation of *all* char/varchar fields in
every table in a given database?

I can do it like 'alter table XYZ alter column Afield char(50)
collate Latin1_General_CI_AS' for every field but that's a hell
of a job...

Groeten,
Jeroen



Relevant Pages

  • Re: Change field collation
    ... You will have to loop through all the columns of all tables and run an ALTER ... TABLE command for each column. ... is there a way to change the collation of *all* char/varchar fields in ...
    (microsoft.public.sqlserver.programming)
  • Re: casesencetive
    ... You can check out these pages within Books Online (right click on the ... You can change the collation of a column by using the ALTER TABLE statement: ... ALTER TABLE MyTable ALTER COLUMN CharCol ... > Outgoing mail is certified Virus Free. ...
    (microsoft.public.sqlserver.programming)
  • Re: Restoring database with different COLLATION
    ... > SET NOCOUNT ON ... > databases collation] ... > CREATE DATABASE TEST ... > the resultin ALTER TABLE statements, ...
    (microsoft.public.sqlserver.msde)
  • Re: Need to reconfigure SQL Server to be Case-Insensitive
    ... You will want to perform ALTER DATABASE and ALTER TABLE statements. ... You can change the collation of a column by using the ALTER TABLE statement: ... applied to all columns, user-defined data types, variables, and parameters ...
    (microsoft.public.sqlserver.server)
  • Re: Alter table (changin collation) & text -datatype
    ... Alter all character -type columns: ... Changing collation on user-tables won't affect the existing collation on the system tables. ... Once the new database is created, test it and if all is well, rename the old one and rename the new one. ...
    (microsoft.public.sqlserver.clients)