Click here to Skip to main content
15,922,696 members
Home / Discussions / Database
   

Database

 
GeneralProblem with SQLserver and updating recordset Pin
Garth5-Aug-02 15:53
Garth5-Aug-02 15:53 
GeneralRe: Problem with SQLserver and updating recordset Pin
Richard Deeming5-Aug-02 23:06
mveRichard Deeming5-Aug-02 23:06 
Generali need your help ...¤Ð__¤Ð; Pin
kims10305-Aug-02 4:56
kims10305-Aug-02 4:56 
Generalmemo fields and other big fields Pin
Roman Nurik4-Aug-02 19:18
Roman Nurik4-Aug-02 19:18 
GeneralRe: memo fields and other big fields Pin
Martin Ziacek5-Aug-02 23:23
Martin Ziacek5-Aug-02 23:23 
GeneralRe: memo fields and other big fields Pin
Roman Nurik6-Aug-02 6:05
Roman Nurik6-Aug-02 6:05 
GeneralCollation Pin
Mazdak3-Aug-02 5:30
Mazdak3-Aug-02 5:30 
GeneralRe: Collation Pin
Richard Deeming5-Aug-02 23:13
mveRichard Deeming5-Aug-02 23:13 
From SQL BOL:

Changing Collations


You can change the collation of a column by using the ALTER TABLE statement:


CREATE TABLE MyTable (
   PrimaryKey   int PRIMARY KEY,
   CharCol      varchar(10) COLLATE French_CI_AS NOT NULL
)
GO
ALTER TABLE MyTable 
   ALTER COLUMN CharCol varchar(10)
   COLLATE Latin1_General_CI_AS NOT NULL
GO

You cannot alter the collation of a column that is currently referenced by:

  • A computed column.
  • An index.
  • Distribution statistics, either generated automatically or by the CREATE STATISTICS statement.
  • A CHECK constraint.
  • A FOREIGN KEY constraint.

You can also use the COLLATE clause on an ALTER DATABASE to change the default collation of the database:
ALTER DATABASE MyDatabase COLLATE French_CI_AS

Altering the default collation of a database does not change the collations of the columns in any existing user-defined tables. These can be changed with ALTER TABLE. The COLLATE CLAUSE on an ALTER DATABASE statement changes:

  • The default collation for the database. This new default collation is applied to all columns, user-defined data types, variables, and parameters subsequently created in the database. It is also used when resolving the object identifiers specified in SQL statements against the objects defined in the database.
  • Any char, varchar, text, nchar, nvarchar, or ntext columns in system tables to the new collation.
  • All existing char, varchar, text, nchar, nvarchar, or ntext parameters and scalar return values for stored procedures and user-defined functions to the new collation.
  • The char, varchar, text, nchar, nvarchar, or ntext system data types, and all user-defined data types based on these system data types, to the new default collation.

After a collation has been assigned to any object other than a column or database, you cannot change the collation except by dropping and re-creating the object. This can be a complex operation. To change the default collation for an instance of Microsoft® SQL Server™ 2000 you must:

  • Make sure you have all of the information or scripts needed to re-create your user databases and all of the objects in them.
  • Export all of your data using a tool such as bulk copy.
  • Drop all of the user databases.
  • Rebuild the master database specifying the new collation.
  • Create all of the databases and all of the objects in them.
  • Import all of your data.


Note Instead of changing the default collation of an instance of SQL Server 2000, you can specify a default collation for each new database you create.
GeneralRe: Collation Pin
Richard Deeming5-Aug-02 23:32
mveRichard Deeming5-Aug-02 23:32 
GeneralRe: Collation Pin
Mazdak7-Aug-02 0:36
Mazdak7-Aug-02 0:36 
GeneralUnicode Pin
Mazdak3-Aug-02 4:50
Mazdak3-Aug-02 4:50 
GeneralRe: Unicode Pin
Mazdak3-Aug-02 5:31
Mazdak3-Aug-02 5:31 
GeneralmySQL and Visual C++ Pin
monrobot132-Aug-02 7:16
monrobot132-Aug-02 7:16 
Generalaccess database over internet connection Pin
_ra2-Aug-02 3:11
_ra2-Aug-02 3:11 
Generaldistinct select error Pin
ns1-Aug-02 9:37
ns1-Aug-02 9:37 
Generaldatabase size Pin
Jassim Rahma29-Jul-02 10:51
Jassim Rahma29-Jul-02 10:51 
GeneralRandomly selecting a row from a database Pin
stephen woolhead29-Jul-02 5:00
stephen woolhead29-Jul-02 5:00 
GeneralRe: Randomly selecting a row from a database Pin
AndyG29-Jul-02 7:29
AndyG29-Jul-02 7:29 
Generaldatabase Pin
Shotgun28-Jul-02 13:11
Shotgun28-Jul-02 13:11 
GeneralRe: database Pin
Chris Maunder28-Jul-02 13:59
cofounderChris Maunder28-Jul-02 13:59 
GeneralRe: database Pin
Alexandru Savescu29-Jul-02 21:30
Alexandru Savescu29-Jul-02 21:30 
GeneralRe: database Pin
David Salter5-Aug-02 11:33
David Salter5-Aug-02 11:33 
GeneralBulk loading in .Net Pin
Anonymous27-Jul-02 8:57
Anonymous27-Jul-02 8:57 
GeneralRe: Bulk loading in .Net Pin
Andres Manggini27-Jul-02 12:16
Andres Manggini27-Jul-02 12:16 
GeneralRe: Bulk loading in .Net Pin
Anonymous27-Jul-02 18:41
Anonymous27-Jul-02 18:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.