今天看公司代码发现添加某列时,出现了
COLLATE SQL_Latin1_General_CP1_CI_AS NULL
如下:
CREATE TABLE [enstep].[DealModelHeaderValues]
(
[DealModelHeaderValueUID] [bigint] NOT NULL,
[ModelCompositeOrderSEQ] [int] NULL,
[TimeZoneUID] [smallint] NOT NULL,
[PriceRoundingMethod] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[NetValueUnitRoundingMethod] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
)
ALTER TABLE [ENSTEP].[DealModelHeaderValues] ADD CurveAverageRoundingMethod [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
刚开始一脸懵,查了相关资料
相关解答如下:
ALTER TABLE [ENSTEP].[DealModelHeaderValues] ADD CurveAverageRoundingMethod [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
所以上面这个ALTER的意思就是,给表DealModelHeaderValues新增一列CurveAverageRoundingMethod ,且当sql查询器查询该列时使用charset latin 1处理字符串,且不区分大小写的比较,并区分音符。