January 16, 2014 at 4:38 pm
I've got a For Each File container. Within that, I have a script which reads the file name, and decides some things based on that. I was able to get it to display the Filename in a msgbox at one point, but it quit working.
I set a break point, then ran debug from the top level, not the script level. Everything turns yellow, and it doesn't drop down into code. If I double click on the script task, it drops me into code, but nothing is highlighted and nothing happening.
If I press the debug button within the script code, it brings up another instance of VS and wants me to select a file to run. That is boggling.
So, I'm unable to step through the script at the moment.
Any ideas how I can step through my code, or what the hell is going on with this, particularly the script debugger bringing up another instance of VS and wanting me to select a file.
VS 2008, the one that comes with SS. My script language is VB.
David
PS Just tried to add some watches to some variables, and I can't find the Watch menu choice. I went to Debug/Windows, but only choices I have there are Immediate, and Output.
Ok, have to be in Debug mode to set watches, and can't debug a Script task, only Script component. I'm also using an SSIS 2005 book to figure out SSIS 2008, but the help function is giving me pretty much the same info.
What good is a script task if you can't debug it?
January 16, 2014 at 5:06 pm
Have you check the setting of InteractiveMode in your project properties under the debugging section?
MM
select geometry::STGeomFromWKB(0x0106000000020000000103000000010000000B0000001000000000000840000000000000003DD8CCCCCCCCCC0840000000000000003DD8CCCCCCCCCC08408014AE47E17AFC3F040000000000104000CDCCCCCCCCEC3F9C999999999913408014AE47E17AFC3F9C99999999991340000000000000003D0000000000001440000000000000003D000000000000144000000000000000400400000000001040000000000000F03F100000000000084000000000000000401000000000000840000000000000003D0103000000010000000B000000000000000000143D000000000000003D009E99999999B93F000000000000003D009E99999999B93F8014AE47E17AFC3F400000000000F03F00CDCCCCCCCCEC3FA06666666666FE3F8014AE47E17AFC3FA06666666666FE3F000000000000003D1800000000000040000000000000003D18000000000000400000000000000040400000000000F03F000000000000F03F000000000000143D0000000000000040000000000000143D000000000000003D, 0);
January 16, 2014 at 5:17 pm
It doesn't seem to give me me that option.
All I see are:
Windows
Start Debugging
Start without Debugging
Attach to Process
Step Over
Toggle Breakpoints
Delete Breakpoints
Disable Breakpoints
January 16, 2014 at 5:19 pm
Ah, I had to go to the Property Pages for the project.
InteractiveMode = True.
January 16, 2014 at 5:58 pm
This is the code within Main, with much of it commented out:
Public Sub Main()
' Add your code here
'
Dim vs As Variables
Dim thisFile As String
Dim fileType As String
Dts.VariableDispenser.LockOneForWrite("FileType", vs)
Dts.VariableDispenser.LockOneForRead("FileName", vs)
thisFile = vs.Item("FileName").Value.ToString
MsgBox(thisFile)
'If Left(thisFile, 5) = "Cccoo" Then
' vs.Item("FileType").Value = "Cccoo"
'ElseIf Left(thisFile, 5) = "Weekl" Then
' vs.Item("FileType").Value = "CM"
'End If
'fileType = vs.Item("FileType").Value.ToString
'MsgBox(vs.Item("FileName").Value.ToString)
'MsgBox(fileType)
'Dts.VariableDispenser.LockOneForWrite("FileDate", vs)
'vs.Item("FileDate").Value = Left(Right(Dts.Variables("FileName").Value.ToString, 14), 8)
'Dts.TaskResult = ScriptResults.Success
'MsgBox(vs.Item("FileName").Value.ToString + " " + vs.Item("FileType").Value.ToString + " " + vs.Item("FileDate").Value.ToString)
vs.Unlock()
End Sub
January 17, 2014 at 12:02 am
If you want to debug the script task, you need to set a breakpoint inside the script task.
Breakpoints in the control flow are for debugging the package itself. If the package stops, you can inspect variables for example. It doesn't allow you to enter the script task though.
Conclusion: 2 breakpoints possible. One for control flow, one for .NET script task.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
January 17, 2014 at 8:25 am
The good ol' MessageBox still works in a script task; not very elegant, but better than nothing.
Rob
January 17, 2014 at 10:02 am
So, if I want to do extensive variable and data manipulation in the process, is it better to use an external compiled module? I've done that in the past, when SSIS just seemed to throw up a roadblock wherever I tried to do something.
January 19, 2014 at 5:52 am
nonghead-webspam (1/17/2014)
So, if I want to do extensive variable and data manipulation in the process, is it better to use an external compiled module? I've done that in the past, when SSIS just seemed to throw up a roadblock wherever I tried to do something.
Depends on what you want to do.
A regular script task/component already goes a long way.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
January 20, 2014 at 12:11 am
Not an answer - I get these ssis problems too...arrrrrgh. 🙁
January 20, 2014 at 1:04 am
nonghead-webspam (1/17/2014)
So, if I want to do extensive variable and data manipulation in the process, is it better to use an external compiled module? I've done that in the past, when SSIS just seemed to throw up a roadblock wherever I tried to do something.
Have you been able to set a breakpoint within the script itself?
Not by clicking 'Debug', but by editing the script, selecting the row where you want the breakpoint and clicking in the left-hand margin. A red dot will appear against the row, showing that there is a breakpoint there.
When you have done this, close the script task editor - you will see that the script task now has a red dot inside it.
Now run the package and it should drop into debug mode when the breakpoint is hit.
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
Viewing 11 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply