• Increase font size
  • Default font size
  • Decrease font size
Home Integration Services Value of a variable finding in SSIS

Value of a variable finding in SSIS

E-mail Print
(0 votes)

private_detective_unlock_128 SSIS contains a number of debugging tools. The one which I could not find was a tool to be able to trace variable-values at runtime. Just search on the internet did wonders.

It is often useful to know the value of a variable is filled during the run. With this simple script that stops you in a script task you can achieve this. You do have absolutely no understanding of programming. First create a scriptask on. Place it somewhere at the end of your Control Flow.

script_designscript

True then the following script:

  Sub Main ( ) Public Sub Main ()

  variableName As String = "User::VandaagDatumID" Dim variableName As String = "User:: VandaagDatumID"

  vars As Variables = Nothing Dim vars As Variables = Nothing

  . LockForRead ( variableName ) Dts. Variable Dispenser. LockForRead (variableName)
  . GetVariables ( vars ) Dts. Variable Dispenser. GetVariables (vars)

  variableValue As String = CType ( vars ( variableName ) . Value , String ) Dim variable As String Value = CType (vars (variableName). Value, String)

  ( ) vars. Unlock ()

  . FireInformation ( -1 , "Test Script" , String . Format ( _ Dts. Events. Fire Information (-1, "Test Script", String. Format (_
  , variableName, variableValue ) , _ "The value for VandaagDatumID variable (0) '(1)'", variableName, variable value), _
  . Empty , -1 , False ) String. Empty, -1, False)

  = Dts. Results . Success Dts. Task Result = Dts. Results. Success

  End Sub 

Articles / SSIS / script_variable_find / script_createscript.jpg

Watch out here in the name of the variable (VandaagDatumID). If you now run the ETL package you will be the output value of the variable window to see.

Articles / SSIS / script_variable_find / script_outputwindow.jpg

Copyright 2008. All Rights Reserved.

Trackback (0)

TrackBack URI for this post

Comments (1)

RSS feed Comments
...
76
Another option is to use the standard Visual Studio Breakpoints and the Watch Window.
Although this solution would be a good alternative!
, februari 25, 2009 Mark Waterreus , February 25, 2009
  • Report abuse
  • 0
  • Report abuse
  • Report abuse

Write comment

bold italicize underline strike url image quote smile wink laugh grin angry sad shocked cool tongue kiss cry
| groter smaller | bigger
security image
Write the displayed characters

busy