ETL 導入數據問題

2006-12-20
解決源文件excel文件列為數字時無法導入數字字母組合,日期格式中有“中午”時,在源文件也就是導入excel數據時就對這些列進行更改(在源列加‘A’)。然後在導入倒sql時,對這些列去除多余部分

操作如下:

declare @a varchar(30)
set @a='2007/1/30 上午 09:20:07'
select
case
when  @a like '%上午%' then convert(datetime,replace(@a,'上午','')+'AM')
when  @a like '%下午%' then convert(datetime,replace(@a,'下午','')+'PM')
end as 'tt'
posted @ 2006-12-20 15:52  Nina  阅读(408)  评论(1编辑  收藏  举报