Heim  >  Artikel  >  Datenbank  >  SQL Server 2000中修改数据库COLLATE的实例

SQL Server 2000中修改数据库COLLATE的实例

WBOY
WBOYOriginal
2016-06-07 16:22:55941Durchsuche

1. 要确定没有其他人连接当前的数据库. 可以用sp_who查看,再用kill @spid强制关闭其连接. 2. 执行SQL,修改DB的Collate属性 USE [master] GO ALTER DATABASE [My_DB] COLLATE Finnish_Swedish_CS_AS GO 3. 得到原先用到的Collate Use [My_DB] select distinct

   1. 要确定没有其他人连接当前的数据库. 可以用sp_who查看,再用kill @spid强制关闭其连接.

  2. 执行SQL,修改DB的Collate属性

  USE [master]

  GO

  ALTER DATABASE [My_DB] COLLATE Finnish_Swedish_CS_AS

  GO

  3. 得到原先用到的Collate

  Use [My_DB]

  select distinct collationid from syscolumns

  4. 设置允许更新系统表(注意, SQL Server 2005中,你无法更新系统表!)

  EXEC sp_configure 'allow updates',1

  RECONFIGURE WITH OVERRIDE

  5.将第三步得到的collationid,更新为新的

  update syscolumns set collationid = 49162 --new

  where collationid in (1359003656) --old

  6. 关闭更新系统表功能

  EXEC sp_configure 'allow updates',0

  RECONFIGURE WITH OVERRIDE

  OK.

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn