如何更改特定数据库的整理 [英] How to Change the Collation of Particular Database
问题描述
您好,
我在一个Windows应用程序中工作,为此我使用sqlserver 2008进行数据库连接。
现在我想将默认排序规则更改为我的数据库的Indic_General_90_CI_AS但sql server不允许这样做。它显示错误,如
排序' ' Indic_General_90_CI_AS
''仅支持Unicode数据类型,不能在数据库或服务器级别设置。
这是我的商店程序
Hello,
I am working in one windows application and for that i use sqlserver 2008 for database connectivity.
Now i want to change default collation as Indic_General_90_CI_AS for my database but sql server not allow to do that.it show me the error like
Collation ''Indic_General_90_CI_AS
'' is supported on Unicode data types only and cannot be set at the database or server level.
And Here is my store Procedure for that
USE [gujarati_demo]
GO
ALTER DATABASE gujarati_demo COLLATE Indic_General_90_CI_AS
GO
/*select COLLATIONPROPERTY ('Indic_General_90_CI_AS','@gujarati_demo')*/
/****** Object: StoredProcedure [dbo].[SP_guj] Script Date: 05/31/2013 17:10:02 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[SP_guj]
(
@Parameter int = 0,
@Name Nvarchar(max)= Null
)
AS
set QUOTED_IDENTIFIER ON
begin transaction
DECLARE @SQL_Query VARCHAR(max)
if @Parameter = 1 /* Inserting Party */
begin
insert into gujarati_demo values (@Name)
end
if @Parameter = 2 /* Inserting Party */
begin
select Name FROM gujarati_demo WHERE Name=@Name
end
Commit Transaction
如果有任何人有此错误的解决方案,请帮助我。
预先感谢和问候
If any one have the solution of this error please help me.
Advance Thanks and Regards
推荐答案
请参考以下链接及所有相关内容:
使用排序规则 [ ^ ]
使用Unicode数据 [ ^ ]
收集优先顺序(Transact-SQL) [ ^ ]
COLLATE(Transact-SQL) [ ^ ]
Please, refer below links and all related:
Working with Collations[^]
Working with Unicode Data[^]
Collation Precedence (Transact-SQL)[^]
COLLATE (Transact-SQL)[^]
这篇关于如何更改特定数据库的整理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!