Click here to Skip to main content
14,826,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a Row Sampling Transformation in my Data Flow Task. I want to be able to set the property 'Number of rows' using the property expression.
I have set a user defined variable called SampleCount as an Int32 with a default value of 750, in scope of the data flow task.
This MSDN[^] specifies that the value of this property can be specified by using a property expression.

I have tried to set the SamplingValue property to @[user::SampleCount], but I get a error, "Property value is not valid. @[user::SampleCount] is no a valid value for Int32"

So the question is, why am I not able to access the property expression for the SamplingValue property?

Updated 1-Aug-16 15:46pm

You cannnot do this on Row Sampling component.
But you can do this by setting Expressions on the parent DataFlow(from Control Flow) of Row Sampling component.

1. Go the Control Flow Tab of your Package.
2. Select and Right Click the DataFlow contains your "Row Sampling" component then select Properties.
3. Click on ellipses(...) on Expressions
4. From the drop down under "Property" select "[Row Sampling].[SamplingValue]". Note : if you have renamed your "Row Sampling", please look for that name.
4. Click on ellipses(...) on Expressions, from the window pops up, Exapand Varaiables by clicking + sign, drag your variable to Expression area.
6. You are done!
sumibell 10-Oct-12 4:42am
Hi Kuthuparakkal,
Thanks you so much for a quick response. I can now access the property expression. I can say it wasn't obvious, so your help was really appreciated.

I set the SamplingValue property as you have described, but when I view this on the Data Flow tab it doesn't seem to change. Would you know why that is?

Kuthuparakkal 10-Oct-12 5:56am
It could be variable scope issue. Recreate the variable with package as yr scope and try.
ogureisuo 29-Jul-16 2:50am
Hi i followed the steps and it works fine when i run it in VS studio, however when i tried to run it via sql agent i encountered an error:

The result of the expression "@[User::MaximumCount]" on property "\Package__SEQ Insert ETL Logic Here\Foreach Loop Container\DFT Populate Detail.Properties[[Row Sampling].[SamplingValue]]" cannot be written to the property. The expression was evaluated, but cannot be set on the property.
Kuthuparakkal 1-Aug-16 0:19am
This may not be the very first error, please scan log again. I believe it's permission issue because if the pkg runs in VS it runs under your credentials, and when it runs under SQL Agent it runs under the credential used by "SQL Server Services"
hello, i have run successfully the other packages but this one failed. There are no other errors aside from this one.
Dave Kreskowiak 1-Aug-16 22:51pm
You posted this as a SOLUTION to the problem described FOUR years ago. Don't do this.

Start you're own thread and completely describe the problem. Don't hijack someones thread, especially one that's so old.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900