Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8527393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:32:42+00:00 2026-06-11T08:32:42+00:00

I have an SSIS Script component that needs to run some VB.NET code shortly

  • 0

I have an SSIS Script component that needs to run some VB.NET code shortly before it exports data.

I’m feeding this script component each row of a timestamp column. (datatype DT_DBTIMESTAMP)

The input style of the date is as follows: 2012-09-12 16:34:12

I need the VB.NET code to change this so it shows in the format: 09/12/2012 04:34:12 PM

The two key points being that all values need to be padded with a zero if they’re single digits, and all time values need to be in 12 hour format with AM/PM. In short, the style must follow: {0:MM/dd/yyyy hh:mm:ss tt}

Unfortunately, I have very limited VB.NET skills, and I have yet to find an example of this on SO or MSDN. From my searching, it appears I might be able to create a new style of DateTime object and then use a custom date format or something? I can’t for the life of me figure out what to do here.

The autogenerated code from the script component is as follows:

Imports System
Imports System.Data
Imports System.Math
Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper
Imports Microsoft.SqlServer.Dts.Runtime.Wrapper

Public Class ScriptMain
    Inherits UserComponent

    Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)
        '
        ' Add your code here
        '
    End Sub

End Class

So could I do something like:

String.Format("{0:MM/dd/yyyy hh:mm:ss tt}", Row.[DateTimeColumn].toString())

I dunno…totally lost here. First time using script components in SSIS or VB.NET really.

Help???? 🙁

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T08:32:44+00:00Added an answer on June 11, 2026 at 8:32 am

    If you get the data as a Date object, then you can simply call the ToString method and pass the format string, for instance:

    Dim d As Date = columnValue
    Dim formatted As String = d.ToString("MM/dd/yyyy hh:mm:ss tt")
    

    However, if you get the date as a string, then you need to first parse it into a Date object before reformatting it:

    Dim s As String = columnValue
    Dim d As Date = Date.ParseExact(s, "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture)
    Dim formatted As String = d.ToString("MM/dd/yyyy hh:mm:ss tt")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a script component in SSIS on SQLServer 2008 R2, that needs to
SSIS (SQL 2005) packages that have a script task that invoke custom .NET dlls
I have an SSIS package that runs a script component as one step in
I have an SSIS package that performs the following. Run a SQL script Export
I have a SSIS 2008 script component which is setup as a transform (so
I have a problem while executing a SSIS script component. To be honest I
I have a C# script task in SSIS that I can pass a variable
I have a SSIS project that queries a database and get item level data.
I have an SSIS package that queries data from a view using an SQL
I have a SSIS package which exports data from a query into a flat

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.