我正在尝试将记录从一个表插入到另一个表中,并将varchar转换为类型为101(mm / dd / yyyy)的日期格式。发生的奇怪事情是,一旦我运行存储过程,源表数据格式会发生变化,但目标显示旧格式(yyyy-mm-dd)
任何建议。请参阅下面的存储过程
INSERT INTO Sales
(
DEALER
,UW
,SKU
,SKU_DESCRIPTION
,EARNING_TYPE
,TERM
,PRODUCTPURCH
,CONTRACTPURCH
,ACCOUNTINGPURCH
,CONTRACTS_SUM
,PREMIUM
,RESERVE
,FEES
)
SELECT TmpSales.[DEALER]
,TmpSales.[UW]
,TmpSales.[SKU]
,TmpSales.[SKU_DESCRIPTION]
,TmpSales.[EARNING_TYPE]
,TmpSales.[TERM]
,convert(date,TmpSales.[PRODUCTPURCH], 101) as PURCHDATE
,convert(date,TmpSales.[CONTRACTPURCH], 101) as CONPURCHDATE
,convert(date,TmpSales.[ACCOUNTINGPURCH], 101) as ACCDATE
,TmpSales.[CONTRACTS_SUM]
,(TmpSales.[RESERVE] + TmpSales.[FEES]) as PREMIUM
,TmpSales.[RESERVE]
,TmpSales.[FEES]
FROM [dbo].[Tmp_Sales_Upld] as TmpSales