Often, you need to see the current value of a variable in SSIS. There are several ways to accomplish this, but my favorite is the Message Box. You can use either VB or C# to display the value of a variable.

First, enable the variable as a read write or read only variable from the Script Task Editor settings:

Lastly use the code below to display the current value in a Script Task:

Public Sub Main()
'
' Add your code here
'
 
MessageBox.Show(Dts.Variables("User::FileName").Value.ToString())
Dts.TaskResult = ScriptResults.Success
 
End Sub

This is all it takes to display a quick, informative message as seen below.

Success

Rudy

Rudy Rodarte is a SQL Server Database professional based in Austin, TX. Over his career, Rudy has worked with SSRS, SSIS, performance tuning troubleshooting. When away from Keyboard, Rudy goes to Spurs and Baylor Bear sporting events.

More Posts - Website - Twitter