今天同事問了一個問題。
Declare @tblCUSTADR table
(
[CUST_ID] [char] (6) NOT NULL ,
[Seq] [char] (1) COLLATE Chinese_Taiwan_Stroke_CI_AS NOT NULL,
[Sale_ADR] [nvarchar](60) COLLATE Chinese_Taiwan_Stroke_CI_AS NOT NULL
)
insert into @tblCUSTADR(CUST_ID, Seq, Sale_ADR)
VALUES('A19834', '4', N'台北縣新莊市新泰路號-新杏店')
select t.* from customerAddress address
inner join @tblCUSTADR t on address.SubSeq = t.Seq
inner join Customer on t.CUST_ID = Customer.Cust_ID
結果出現了下面的錯誤訊息。
Msg 446, Level 16, State 9, Line 16
無法解析equal to 動作的定序衝突。
真是受不了,第一次碰到定序的問題。
解法如下:
select * from customerAddress address
inner join @tblCUSTADR t on address.SubSeq COLLATE Chinese_Taiwan_Stroke_CI_AS = t.Seq COLLATE Chinese_Taiwan_Stroke_CI_AS
inner join Customer on t.CUST_ID = Customer.Cust_ID
COLLATE Chinese_Taiwan_Stroke_CI_AS
沒有留言:
張貼留言