更改数据库的排序规则后出错
<P>前段时间本机数据有些地方是乱码(显示为?),不想重装,</P><P>于是就用语句将数据库的排序规则更改了,改完为没有发现有什么问题,</P><P>但过了一个月左右的时间,系统就出现问题了,</P><P>报错如下:</P><P> <img border=0 src=attachments/bbsxp/2009-4/200947165951.jpg></P><P><img border=0 src=attachments/bbsxp/2009-4/20094717138.jpg></P><P> </P><P> </P><P>我采用的SQL语句如下:</P><P>1、查询数据库排序方法,可以获得更多的规则: <BR> SELECT * <BR> FROM ::fn_helpcollations() </P><P> <BR>2、要关闭所有连接<BR>方法:在查询分析器中用下面的方法,注意修改数据库名: <BR> <BR> /* <BR> 关闭用户打开的进程处理 <BR> */ <BR> use master <BR> go <BR> <BR>3.------<BR> use master <BR> go </P><P> if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[p_killspid]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) <BR> drop procedure [dbo].[p_killspid] <BR> GO <BR> <BR> create proc p_killspid <BR> @dbname varchar(200) --要关闭进程的数据库名 <BR> as <BR> declare @sql nvarchar(500) <BR> declare @spid nvarchar(20) <BR> <BR> declare #tb cursor for <BR> select spid=cast(spid as varchar(20)) from master..sysprocesses where dbid=db_id(@dbname) <BR> open #tb <BR> fetch next from #tb into @spid <BR> while @@fetch_status=0 <BR> begin <BR> exec('kill <A target=_blank href="mailto:'+@spid" target=_blank>'+@spid</A>) <BR> fetch next from #tb into @spid <BR> end <BR> close #tb <BR> deallocate #tb <BR> go <BR> <BR> --关闭用户连接 <BR> exec p_killspid '数据库名' <BR> go <BR> <BR>4、修改数据库排序规则 <BR>Alter database 数据库名 collate Chinese_PRC_BIN </P><P> </P><P>现在该如何处理?在不重装基础上,能不能挽救?</P><P> </P><P> </P><p>[此帖子已被 luoxiong 在 2009-4-7 17:02:40 编辑过]Re:更改数据库的排序规则后出错
<P>请参考下面这篇帖子我在7楼的回复。</P><P><A target=_blank href="http://www.sagesoft.cn/bbs/ShowPost.asp?ThreadID=1319" target=_blank>http://www.sagesoft.cn/bbs/ShowPost.asp?ThreadID=1319</A></P><P>若你的DB为sqlserver2000,建议迁移到sqlserver2005/oracle上来。</P><p>[此帖子已被 tansj 在 2009-4-7 22:51:59 编辑过]页:
[1]