accessing timezoneinfo class in SSIS script
I can see TimeZone class, but not TimeZoneInfo class and it's the latter that I need. How do I add a reference to fetch correct assemblies? TimeZoneInfo is a .Net Framework 3.5 class. So to start I think you have to change the Target Framework of the Script Task/Component to 3.5. Goto the properties of your Script project (Project Explorer in the script window). Right click the project and select properties. There you will find the Target Framework. After that you can reference to Net Framework 3.5 assemblies.Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com
July 16th, 2011 8:10am

I need to perform some timezone conversions when processing datetime data for upload into a data warehouse. I have the datetime coming in UTC format and have the timezone info referred to by Windows time zone id (e.g. 'Central European Standard Time') I need to convert the datetime into respective local datetime. I am thinking to use a script component for the conversion and would like to use methods of the timezoneinfo class to perform the task. However the editor doesn't recognize the timezoneinfo type when I am trying to use it. It just doesn't see the class. How can I get access to this class from SSIS? Is there any better way to do the timezone conversion?
Free Windows Admin Tool Kit Click here and download it now
July 16th, 2011 8:52am

My .NET skills aren't that strong, but maybe you need to add a reference to the script task so that .NET can fetch the correct assemblies? Or add an IMPORTS statement at the top? (I must add that when I try it in a script component, I can immediately see the TimeZone class)MCTS, MCITP - Please mark posts as answered where appropriate. Answer #1: Have you tried turning it off and on again? Answer #2: It depends...
July 16th, 2011 8:55am

Setting the Target Framework did it. :-) One note though... This was only possible in C# script project and not in VB script. At least I couldn't find where to set Target Framework for the VB script project. It doesn't matter. I can work in C#. Thanks a LOT! You saved me a very expensive workaround.
Free Windows Admin Tool Kit Click here and download it now
July 16th, 2011 10:36am

I can see TimeZone class, but not TimeZoneInfo class and it's the latter that I need. How do I add a reference to fetch correct assemblies?
July 16th, 2011 11:39am

You can use .NET assemblies in the scripts in SSIS, but not simply with add reference, this is a sample: http://beyondrelational.com/blogs/niteshrai/archive/2010/04/13/referencing-an-assembly-inside-ssis-script-task.aspxhttp://www.rad.pasfu.com My Submitted sessions at sqlbits.com
Free Windows Admin Tool Kit Click here and download it now
July 17th, 2011 1:23am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics