Showing posts with label properties. Show all posts
Showing posts with label properties. Show all posts

Wednesday, March 28, 2012

Read/Write for Variables

Hi,

I am using a Script Component and I have a Read/Write Variable varStatusCase (as assigned in the Custom Properties of my Script Component). I used this inside my script to get a specific value. However, when I ran it I get this error:

The collection of variables locked for read and write access is not available outside of PostExecute.

How do I repair this?

Thanks,

cherriesh

If you want to write on a variable you have to use the post execute method something like this

Public Overrides Sub PostExecute()

Me.Variables.varName = Something

End Sub

I dont know if there's another way to do it but this is the only one i've found. And it works.

|||

But just know that this doesn't execute for every row.

|||

Check if this post help you!

http://pedrocgd.blogspot.com/2007/05/ssis-populating-dimension_28.html

Regards!

|||

hi,

I tried doing what is in your link:

Private NextKey As Int32 = 0

Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)

Dim MaxKey As Integer = Me.Variables.varStatus

NextKey = MaxKey + 1

Row.oStatusCode = NextKey

MyBase.PreExecute()

End Sub

Public Overrides Sub PreExecute()

Me.VariableDispenser.LockForRead("User::varStatus")

MyBase.PreExecute()

End Sub

Public Overrides Sub PostExecute()

Me.ReadWriteVariables("varStatus").Value = NextKey

MyBase.PostExecute()

End Sub

My variable "varStatus" is assigned in Script Component ReadWrite Variable.

Am I missing anything? I'm still having the same error.

cherriesh

|||

dear friend,

copy my statment in my post... check the link... the solution is there.

check the pre-execute method

helped?

Wednesday, March 21, 2012

Read All Variables in a Script Task w/o Enumerating Them

I'm having trouble with my configurations. All of my configurations are targeting variables and the various properties are all set to expressions containing the targeted variables. I would like (during debugging) to dump out all of the variables.

Is there a way to access all variables from a script task? It looks like you have to enumerate the variables you want in the ReadOnlyVariables or ReadWriteVariables properties. I'd rather not miss one by forgetting to list it.

No, because there is no way of discovering what variables are available at run-time, and the locking mechanism to get access to the variable and it's value requires a name.

This type of funtionality is only available through the design-time UI interfaces.

|||You might be able to use the OnVariableValueChanged event to capture the variable values as they are set. You do need to make sure that RaiseChangedEvent is true for each variable.|||

Thanks, but the reason for this was to help me understand the details of how the configuration was working. Will OnVariableValueChanged work even if the change was due to loading a configuration?

|||

No, actually it doesn't. I just tested it, and it appears that the event doesn't fire on configurations. Maybe someone from MSFT could comment on why it doesn't? I can guess a few reasons, but I think there are some valid scenarios where you would want to capture values even when they are set from configurations.

Back to your original question, they are adding a Watson-style debugger in 2008 that will dump the current state of the package on demand. That will include the variable values. Not a big help today, but something to look forward to.

|||

Actually, the 2008 version will help once released. Any info on which CTP that feature will be in?

|||CTP 5, from what MSFT said at the PASS Summit.

Read All Variables in a Script Task w/o Enumerating Them

I'm having trouble with my configurations. All of my configurations are targeting variables and the various properties are all set to expressions containing the targeted variables. I would like (during debugging) to dump out all of the variables.

Is there a way to access all variables from a script task? It looks like you have to enumerate the variables you want in the ReadOnlyVariables or ReadWriteVariables properties. I'd rather not miss one by forgetting to list it.

No, because there is no way of discovering what variables are available at run-time, and the locking mechanism to get access to the variable and it's value requires a name.

This type of funtionality is only available through the design-time UI interfaces.

|||You might be able to use the OnVariableValueChanged event to capture the variable values as they are set. You do need to make sure that RaiseChangedEvent is true for each variable.|||

Thanks, but the reason for this was to help me understand the details of how the configuration was working. Will OnVariableValueChanged work even if the change was due to loading a configuration?

|||

No, actually it doesn't. I just tested it, and it appears that the event doesn't fire on configurations. Maybe someone from MSFT could comment on why it doesn't? I can guess a few reasons, but I think there are some valid scenarios where you would want to capture values even when they are set from configurations.

Back to your original question, they are adding a Watson-style debugger in 2008 that will dump the current state of the package on demand. That will include the variable values. Not a big help today, but something to look forward to.

|||

Actually, the 2008 version will help once released. Any info on which CTP that feature will be in?

|||CTP 5, from what MSFT said at the PASS Summit.

Read All Variables in a Script Task w/o Enumerating Them

I'm having trouble with my configurations. All of my configurations are targeting variables and the various properties are all set to expressions containing the targeted variables. I would like (during debugging) to dump out all of the variables.

Is there a way to access all variables from a script task? It looks like you have to enumerate the variables you want in the ReadOnlyVariables or ReadWriteVariables properties. I'd rather not miss one by forgetting to list it.

No, because there is no way of discovering what variables are available at run-time, and the locking mechanism to get access to the variable and it's value requires a name.

This type of funtionality is only available through the design-time UI interfaces.

|||You might be able to use the OnVariableValueChanged event to capture the variable values as they are set. You do need to make sure that RaiseChangedEvent is true for each variable.|||

Thanks, but the reason for this was to help me understand the details of how the configuration was working. Will OnVariableValueChanged work even if the change was due to loading a configuration?

|||

No, actually it doesn't. I just tested it, and it appears that the event doesn't fire on configurations. Maybe someone from MSFT could comment on why it doesn't? I can guess a few reasons, but I think there are some valid scenarios where you would want to capture values even when they are set from configurations.

Back to your original question, they are adding a Watson-style debugger in 2008 that will dump the current state of the package on demand. That will include the variable values. Not a big help today, but something to look forward to.

|||

Actually, the 2008 version will help once released. Any info on which CTP that feature will be in?

|||CTP 5, from what MSFT said at the PASS Summit.

Reactivating an expired Subscription

Hi all,
One of the subscribers I am managing is displaying a message saying that the
pull subscription has expired although the publication properties on the
publisher is showing that the publication never expires. Is there a way to
"reactivate" the expired subscription without re-initializing it.?
Thanks
It is possible for transactional, but you are best off to drop the
subscription and do a no sync. Then run a validation and determine how out
of sync you are. After you have done this evaluate whether to proceed. You
may want to re-initialize and regenerate and deploy the snapshot. If not,
you might want to run in the continue on data consistency errors profile.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"imad koussa" <imad.koussa@.aims-co.com> wrote in message
news:ud7tR6rvFHA.3124@.TK2MSFTNGP12.phx.gbl...
> Hi all,
> One of the subscribers I am managing is displaying a message saying that
the
> pull subscription has expired although the publication properties on the
> publisher is showing that the publication never expires. Is there a way to
> "reactivate" the expired subscription without re-initializing it.?
> Thanks
>
>

Friday, March 9, 2012

RDL file not maintaining Extended File Properties

Please try this if you want...
1 For a .RDL file, right click on the file its self and select
"properties"
2 Click the "Summary" tab and enter information in any of the text
fields (Subject, author, ...)
3 Save it and then copy the file on another computer, is your metadata
missing just like mine?
It seems to be saving it somehow locally, but does not transfer with
the file. What gives?
We were originally trying to add some of the install info in here, but
seems to only be local.
Weird thing is... if you look at the same file over the network from
another computer, the information looks to be there, it looses it when
copied.oh well. I just found out why. This data is actually stored in NTFS
and is not in the file. Any time the file is copied into source safe
or email all properties are lost.