則無法進行join的動作!
錯誤訊息:Cannot resolve the collation conflict between "Chinese_PRC_CI_AS" and "Chinese_Taiwan_Stroke_CI_AS" in the UNION operation.
解決方法:在要參照的key後加上相同的定序名稱即可解決
select S.ProdNo,P.PnameD
from STK S,Prod P
where S.ProdNo COLLATE Chinese_PRC_Stroke_CI_AS = P.ProdNo COLLATE Chinese_PRC_Stroke_CI_AS
創建表格時也可一併設定定序,如下:
if (select OBJECT_ID('tempdb..#ExpandRubBOMD')) IS NOT NULL Drop Table #ExpandRubBOMD
CREATE TABLE #ExpandRubBOMD(
[MixRubNo] [varchar](5) collate Chinese_PRC_Stroke_CI_AS NOT NULL,
[ProdNo] [varchar](16) collate Chinese_PRC_Stroke_CI_AS NOT NULL,
[Wgt] [varchar](30) collate Chinese_PRC_Stroke_CI_AS NULL CONSTRAINT [DF_ExpandRubBOMD_Wgt_Dean] DEFAULT ((0)) )
沒有留言:
張貼留言