Just a quick tutorial on using a script component as a source… Follow the link for screenshots.

First things first. Add a script component to the data flow. When prompted, select “Source” as the component type. (click on images for full sized version)

SSIS - Script Source Component 1

Next, for clarity’s sake, I’ll rename the default output. (An output simply contains a set of columns and will correlate to the green arrow on the data flow. The more outputs you have, the more green arrows you can use.) I’ll rename the default output, “Output 0″ to “MyOutput.”

SSIS - Script Source Component 2

Next, I’ll add an output column called, “MyColumn” and its type will be an integer. Be sure to change the type accordingly.

SSIS - Script Source Component 3

From here, we can edit the script by clicking on the script section on the left of the above window. From there click on the “Design Script…” button. Below is the setup:

SSIS - Script Source Component 4

Notice how when I type, I am automatically prompted for a list of available items to choose from. One of them is the column I added previously. Let’s pick the column and assign a value of 123 to it. Full script below:

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 CreateNewOutputRows()
MyOutputBuffer.AddRow()
MyOutputBuffer.MyColumn = 123
End Sub

End Class

You can close the script and then click OK on the script component dialog box. Now when you hook this source up to another component, you’ll end up with one column with one row with a value of 123.