How to change the collation of SQL SERVER 2000
Alter Datebase ALTER DATEBASE database Chinese_prc_bin
ALTER TABLE TB
ALTER COLUMN colname nvarchar (+) COLLATE chinese_prc_ci_as
--Case insensitive
ALTER TABLE TB
ALTER COLUMN colname nvarchar (+) COLLATE chinese_prc_cs_as
--Case sensitive
You can get more rules by using the following command:
SELECT *
From:: Fn_helpcollations ()
After you change the collation of the database, the collation of the fields in the table remains the same, and if you go to a field in the Enterprise Manager interface in the design table, a field change is tiring,
EXEC sp_configure ' allow updates ', 1 RECONFIGURE with OVERRIDE
Update dbo.syscolumns set collationid=65572 where collationid=53284
EXEC sp_configure ' allow updates ', 0 RECONFIGURE with OVERRIDE
Go
When you modify the collation of the database, make sure that your database does not have any connections.
It is best to change the database name in the Query Analyzer using the following method:
/*
Turn off user-opened process processing
*/
Use master
Go
if exists (SELECT * from dbo.sysobjects WHERE id = object_id (N ' [dbo].[ P_killspid] ') and OBJECTPROPERTY (ID, N ' isprocedure ') = 1)
drop procedure [dbo]. [P_killspid]
GO
Create proc P_killspid
@dbname varchar (200)--the database name of the process to be closed
As
declare @sql nvarchar (500)
declare @spid nvarchar (20)
DECLARE #tb cursor FOR
Select Spid=cast (spid as varchar) from master: sysprocesses where dbid=db_id (@dbname)
Open #tb
FETCH NEXT from #tb into @spid
While @ @fetch_status =0
Begin
EXEC (' kill '[email protected])
FETCH NEXT from #tb into @spid
End
Close #tb
Deallocate #tb
Go
--Close User connection
EXEC p_killspid ' database name '
Go
--Modify Collation
Alter Datebase ALTER DATEBASE database name Chinese_prc_bin
Go Collation of SQL SERVER