关于字符集不匹配的问题求助

fspaul314 2002-06-08 11:18:11
我以前装了部NT,在上面安装了SQL SERVER7.0,跑了一个数据库应用,最近,数据库莫名其妙,客户端突然一下子全连不上数据库,但服务器上的数据库服务是正常启动的,用enterprise manager可以读出数据。但将EXE应用程序在服务器上运行都说连不上数据库。我查不出原因,就将两个数据库文件,拷到另外目录下,卸载了SQL
server7.0,然后重新安装了一遍(所用安装盘与第一次安装的相同),然后想用sp_attachdb 的命令将两个数据库文件加载进来,但它出错了,提示:
Server:msg 1816,level6,state1 line1
could not attach the database because the character set ,sort order,or unicode collection for the database differ from this server.
warning:unicode ccomparisio flags 19611 in database differs from server unicode comparision flags of 196609.
我知道它说数据库字符集与操作系统字符集不匹配,我不知如何解决。。。。你能否解答一下,此系统已经停了十天左右了,所有工作均不能进行。由于NT上又安装了许多其他程序,最好不要重装。主要是数据重要。
不知是否要装补丁。。。但为何以前行的,现在不行,NT与SQL SERVER与以前是同一套碟呀?




...全文
201 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
tiger_qi 2002-06-08
  • 打赏
  • 举报
回复
对,建议采用方法2
duckcn 2002-06-08
  • 打赏
  • 举报
回复
不需要重装系统。
1,重装sql server,不要默认安装,要手动设置sql server的字符集和排序规则,按你的出错信息,就把排序规则(sort order)设成19611即可,不过我查了一下,没查到19611和196609这两个究竟代表哪种,只能你自己试了;
2,重建master数据库,作之前最好把你的master备份,重建之后好再恢复。如何重建联机帮助讲得很清楚的。
zhoujianfan 2002-06-08
  • 打赏
  • 举报
回复
sql sever也不要重装。见上
zhoujianfan 2002-06-08
  • 打赏
  • 举报
回复
<<sql server books online>>
Changing the Character Set, Sort Order, or Unicode Collation
The character set, sort order, and Unicode collation are fundamental to the structure of all Microsoft® SQL Server™ databases. In order to change one or more of these settings, you must rebuild the master and user databases.

Follow these steps to rebuild the databases and maintain their contents.

Back up the definitions of objects you want to preserve.
Use SQL Server Enterprise Manager to create scripts for all of the objects in the user databases and master database.

Export data from the user tables.
Use Microsoft Data Transformation Services (DTS) or the bcp bulk copy utility to unload the user data.

Rebuild the master database.
Run the Rebuildm.exe command prompt utility. You can select new character set, sort order, and Unicode values and rebuild the master database with these new settings.

Create new user databases.
Use SQL Server Enterprise Manager or the CREATE DATABASE statement to re-create the user databases.

Create objects using the scripts created earlier.
Use SQL Server Query Analyzer to run the scripts you created earlier.

Import data into the user tables.
Use DTS or BCP to load data back into the user tables.

34,590

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧