Home  >  Article  >  Database  >  SQL Server 2000中修改数据库COLLATE的实例

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

WBOY
WBOYOriginal
2016-06-07 16:22:55938browse

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.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn