如何修改SQL Server 中数据库的Collation
来源:互联网 发布:东莞软件开发公司 编辑:程序博客网 时间:2024/06/05 22:47
下面是EntLib.com Team 针对本地数据库subtext --- 修改Collation 的操作过程。
默认情况下,Subtext 数据库的collation 并不是 Chinese_PRC_CI_AS ,下面通过SCRIPT 脚本修改其collation:
ALTER DATABASE SubtextData COLLATE Chinese_PRC_CI_AS
但是,你会遇到如下错误信息:
Msg 5075, Level 16, State 1, Line 1
The object 'iter_charlist_to_table' is dependent on database collation. The database collation cannot be changed if a schema-bound object depends on it. Remove the dependencies on the database collation and then retry the operation.
Msg 5072, Level 16, State 1, Line 1
ALTER DATABASE failed. The default collation of database 'SubtextData' cannot be set to Chinese_PRC_CI_AS.
这是因为修改数据库的collation时,必须满足如下条件:
- No one else can be using the database.
- No schema-bound object can be dependent on the database collation. Schema-bound objects include any of the following:
- User-defined functions and views created with SCHEMABINDING
- Computed columns
- CHECK constraints
- Table-valued functions that return tables with character columns with collations inherited from the default database collation
上述错误提示信息表示存在数据库对象'iter_charlist_to_table' 依赖于数据库的collation,因此无法成功修改数据库subtext的collation。
下面进一步查询上述的'iter_charlist_to_table' 对象具体信息:
select * from sys.objects where name='iter_charlist_to_table'
发现 'iter_charlist_to_table' 是一个 Table-valued Function。需要先导出该function 的SQL script脚本,然后删除该function。
这样,ALTER DATABASE SubtextData COLLATE Chinese_PRC_CI_AS 就可以成功执行了。
最后,执行 'iter_charlist_to_table' 导出的脚本,重新创建Table-valued Function 就可以了。
原地址:http://forum.entlib.com/Default.aspx?g=posts&t=285
- 如何修改SQL Server 中数据库的Collation
- Sql server中Collation …
- Sql server中Collation conflict问题
- Sql server中Collation conflict问题
- Sql server中Collation conflict问题
- SQL Server Collation引发的惨案
- SQL Server 更改DB的Collation
- 修改sqlserver数据库的排序规则(collation)
- SQL Server Collation介绍
- SQL SERVER 2005 COLLATION 详解
- Sql server 日记 (Collation)
- sql server 2005 Collation 冲突
- SQL Server的 排序规则(collation)冲突和解决方案
- SQL Server的 排序规则(collation)冲突和解决方案
- SQL Server的 排序规则(collation)冲突和解决方案
- SQL Server的 排序规则(collation)冲突和解决方案
- 如何修改Microsoft SQL Server 2005中sa的密码?
- 如何修改Microsoft SQL Server 2005中sa的密码?
- 模拟电子技术22 38------——多级放大电路 ----阻容耦合 变压器耦合
- 如何防止黑客扫描你的计算机?
- List Control控件技巧总汇
- 破解mxp swc 破解的方法
- 今天立秋
- 如何修改SQL Server 中数据库的Collation
- 《算法之美》の链表问题の从链表中删除节点
- 中国首台千万亿次超级计算机即将组装完毕
- bi publish图表,x轴y轴加说明(单位)--chart
- IIS指标---Web测试重要计数器
- windows机器中删除指定日期文件和目录的bat
- http协议经典格式。转自维基百科
- oracle index相关【转】
- jquery ajax