关于SSIS中代码页(Code Page) 相关错误

本文详细探讨了SQL Server中数据库Collation设置对于数据处理的影响,包括如何查看和更改数据库的Collation设置,以及这些设置如何影响数据库操作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

今天我也遇到这个问题了,真坑爹!让boss说我低能 55555.。。

 

The column “xxxx” cannot be processed because more than one code page (1252 and 936) are specified for…

网上有云:

              将某控件的属性AlwaysUseDefaultCodePage设置为true,DefaultCodePage也应为936

              就可解决

我试了一下 根本不允许设置

后来才发现

与sql server中Collation的设置有关

sql server不同语言的版本在创建数据库时,会默认不同的Collation设置

这才是根本

-----------------------------------------------------------------------------------------------------

CREATE DATABASE TestCollation
go
USE TestCollation
go
SELECT DATABASEPROPERTYEX('TestCollation', 'Collation')
-- the default for us english without changes at the windows layer or changes during SQL Server install is:
-- SQL_Latin1_General_CP1_CI_AS
-- To force it use:
-- CREATE DATABASE TestCollation
-- COLLATE SQL_Latin1_General_CP1_CI_AS

go
-- To see the list of collations use the system function
SELECT * FROM ::fn_helpcollations()
go

-- Since this started from a question on how can I CHANGE collations here's how.
-- Let's change the collation to a case sensitive collation...

ALTER DATABASE TestCollation COLLATE Latin1_General_CS_AS_KS_WS
go

-- Confirm the change?
SELECT DATABASEPROPERTYEX('TestCollation', 'Collation')
go

-- Create some objects
CREATE TABLE dbo.Test
( Col1 int  NOT NULL)
go

CREATE TABLE dbo.test
( Col1 int  NOT NULL)
go

CREATE TABLE dbo.TEST
( Col1 int  NOT NULL)
go

-- Now try to change back to case insensitive...
ALTER DATABASE TestCollation COLLATE SQL_Latin1_General_CP1_CI_AS
go

-- This will generate these helpful messages:
-- Server: Msg 1505, Level 16, State 1, Line 1
-- CREATE UNIQUE INDEX terminated because a duplicate key was found for index ID 2. Most significant primary key is 'test'.
-- Server: Msg 3436, Level 16, State 1, Line 1
-- Cannot rebuild index for the 'sysobjects' table in the 'TestCollation' database.
-- Server: Msg 5072, Level 16, State 1, Line 1
-- ALTER DATABASE failed. The default collation of database 'TestCollation' cannot be set to
SQL_Latin1_General_CP1_CI_AS.

-- To see the server's setting
sp_helpsort

-- To see the database's setting
sp_helpdb TestCollation

-- To see the table's setting (for each column)
sp_help Test

 -------------------------------------------------------------------------------------------------

转载于:https://www.cnblogs.com/zcm123/archive/2012/07/15/2592169.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值