Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Convert DatetimeStamp scale value

$
0
0

I am using SSIS script component to change scale value of a DATETIMESTAMP2 field.

My Input field is DT_DATETIMESTAMP2 ( 6). I want to convert this to DT_DATETIMESTAMP2 ( 6) in my script component.

I will be passing all fields from a table to the script component. 

My code should check if the datatype of the field is DATETIMESTAMP2 and then convert to scale-5.

The fields are readwrite types.

I tried the following but it isnt working,

foreach (PropertyInfo p in Row.GetType().GetProperties())
        {

if (object.ReferenceEquals(p.PropertyType, typeof(DTP_DBTIMESTAMP2)))
            {
                p.SetValue(Row, Convert.ToDateTime(5));
            }

Thanks in Advance



Viewing all articles
Browse latest Browse all 24688

Trending Articles



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