tag:blogger.com,1999:blog-2303058199815958946.post5665527473913720145..comments2024-03-28T10:36:35.016+01:00Comments on Microsoft SQL Server Integration Services: How to use variables in a Script TaskJoost van Rossumhttp://www.blogger.com/profile/01125981589974671317noreply@blogger.comBlogger10125tag:blogger.com,1999:blog-2303058199815958946.post-32454684623510745252016-02-04T10:39:15.330+01:002016-02-04T10:39:15.330+01:00really helpedreally helpedBest Microwave oven https://www.blogger.com/profile/14833255288080389149noreply@blogger.comtag:blogger.com,1999:blog-2303058199815958946.post-31751603854741459422015-04-03T14:22:24.297+02:002015-04-03T14:22:24.297+02:00You can only access variables that are changed by ...You can only access variables that are changed by the Script <strong>Component</strong> after the Data Flow Task is completely finished (in the next task or in a precedence constraint going to the next task).Joost van Rossumhttps://www.blogger.com/profile/01125981589974671317noreply@blogger.comtag:blogger.com,1999:blog-2303058199815958946.post-48574637647318240522015-01-30T13:27:49.091+01:002015-01-30T13:27:49.091+01:00Hi,
This is the first time I am on this blog....
...Hi,<br /><br />This is the first time I am on this blog....<br />I have used the same logic to count the row based on the condition here is the code below. I am not able to access the variables after the update the variables in the script component. Please help.... I am using the variable in the next component to update the column. which is updating as 0.<br />=======================================================<br />Imports System<br /> Imports System.Data<br /> Imports System.Math<br /> Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper<br /> Imports Microsoft.SqlServer.Dts.Runtime.Wrapper<br /><br />Public Class ScriptMain<br /> Inherits UserComponent<br /> Dim X As Integer = 0<br /> Dim Y As Integer = 0<br /><br /> Public Overrides Sub PostExecute()<br /> MyBase.PostExecute()<br /><br /> 'Me.Variables.XX= X<br /> 'Me.Variables.YY= Y<br /> Me.ReadWriteVariables("XX").Value = X<br /> Me.ReadWriteVariables("YY").Value = Y<br /><br /> MessageBox.Show(Me.Variables.XX.ToString)<br /> MessageBox.Show(Me.Variables.YY.ToString)<br /> End Sub<br /><br /> Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)<br /> If (Row.Location = "A") Then<br /> X= X+ 1<br /> ElseIf (Row.Location = "B") Then<br /> Y= Y+ 1<br /> End If<br /> End Sub<br /><br />End Class<br />=============================================<br />Thank you,<br /><br />Anonymoushttps://www.blogger.com/profile/12245913181346653001noreply@blogger.comtag:blogger.com,1999:blog-2303058199815958946.post-82310073147193928502014-06-24T20:04:26.280+02:002014-06-24T20:04:26.280+02:00Thanks, I went successfully with your steps.Thanks, I went successfully with your steps.Anonymoushttps://www.blogger.com/profile/09935097619005479212noreply@blogger.comtag:blogger.com,1999:blog-2303058199815958946.post-42873512859444545672014-03-27T13:25:10.474+01:002014-03-27T13:25:10.474+01:00It's probably locked (by an other task). Pleas...It's probably locked (by an other task). Please post the code and a description/screenshot of your package in the in the <a href="http://social.msdn.microsoft.com/Forums/sqlserver/en-us/home?forum=sqlintegrationservices" rel="nofollow">MSDN SSIS Forum</a>.Joost van Rossumhttps://www.blogger.com/profile/01125981589974671317noreply@blogger.comtag:blogger.com,1999:blog-2303058199815958946.post-48180185365352655842014-03-27T09:31:35.779+01:002014-03-27T09:31:35.779+01:00Mine just hangs. Doesn't do anything . . .Mine just hangs. Doesn't do anything . . .Nickhttps://www.blogger.com/profile/08696629638976495596noreply@blogger.comtag:blogger.com,1999:blog-2303058199815958946.post-75895702377946728782012-12-21T13:35:58.812+01:002012-12-21T13:35:58.812+01:00Can't help you with this. It isn't the act...Can't help you with this. It isn't the actual error message. Best option is to ask a question in <a href="http://social.msdn.microsoft.com/forums/en-US/sqlintegrationservices/threads" rel="nofollow">this forum</a> and give much more details (like code, screenshot, etc.).<br /><br />You could debug your script task or add a <a href="http://microsoft-ssis.blogspot.com/2011/02/script-task-and-component-logging.html" rel="nofollow">try catch with some logging</a> to find the error.Joost van Rossumhttps://www.blogger.com/profile/01125981589974671317noreply@blogger.comtag:blogger.com,1999:blog-2303058199815958946.post-1955407644672136992012-12-21T11:33:31.288+01:002012-12-21T11:33:31.288+01:00Error:
en Microsoft.SqlServer.Dts.Pipeline.Script...Error:<br /><br />en Microsoft.SqlServer.Dts.Pipeline.ScriptComponent.get_ReadWriteVariables()<br /> en SC_a692aa72c9074d25a8f50e490e2fef5d.vbproj.Variables.set_FInicial(DateTime Value)<br /> en SC_a692aa72c9074d25a8f50e490e2fef5d.vbproj.ScriptMain.Input0_ProcessInputRow(Input0Buffer Row)<br /> en SC_a692aa72c9074d25a8f50e490e2fef5d.vbproj.UserComponent.Input0_ProcessInput(Input0Buffer Buffer)<br /> en SC_a692aa72c9074d25a8f50e490e2fef5d.vbproj.UserComponent.ProcessInput(Int32 InputID, PipelineBuffer Buffer)<br /> en Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.ProcessInput(Int32 inputID, PipelineBuffer buffer)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2303058199815958946.post-10326094172069933462012-09-12T17:16:13.320+02:002012-09-12T17:16:13.320+02:00Excellent, thank you :-)Excellent, thank you :-)Anonymoushttps://www.blogger.com/profile/01960985735197467057noreply@blogger.comtag:blogger.com,1999:blog-2303058199815958946.post-35252535562379333562012-08-09T13:41:46.914+02:002012-08-09T13:41:46.914+02:00Thanks for the info, great help!!!Thanks for the info, great help!!!C1arkhttps://www.blogger.com/profile/13859317694932765761noreply@blogger.com