Quantcast
Viewing all articles
Browse latest Browse all 24688

How to write case statement in SSIS expression Derived Column.

Hello ,

I have a data flow task where I am getting a flat file and importing into our staging table. But before I import I am trying to remove the domain from the field called computer name.  Here is the expression written in SQL -

Update table A
set [Computer Name]=case when CHARINDEX('.',[Computer Name])>0 
                         then case when [Computer Name] like '[1-9]%.[1-9]%.[1-9]%' 
						 then [Computer Name]
						 else SUBSTRING([Computer Name],0,CHARINDEX('.',[Computer Name])) end
                         else [Computer Name] end

This works if I run this outside of dataflow. But due to requirement change I need to include this inside data flow and have derived column that will use this expression.

How do I rewrite this under derived transformation?



Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>