Showing posts with label property. Show all posts
Showing posts with label property. Show all posts

Wednesday, March 28, 2012

Persistant VariableName error in Row Count task

I am getting this error:

The variable "MyVariable" specified by VariableName property is not a valid variable. Need a valid variable name to write to.

This is my scenario:

I had a Row Count task on a data flow that was writing to a locally scoped variable (called MyVariable for this example.)

I needed to access the value of this variable at the Control Flow (global scope), so I deleted it and recreated it at that level.

My new variable has the same name as the old variable, just different scope.

Now I get this error every time I run the package.

BUT WAIT THERE'S MORE!

I have another Row Count step in the same data flow that is presently writing to a globally scoped variable called "ErrorRows."

If I change this step to write to MyVariable it works fine. If I change my other step to use ErrorRows, it works fine. If I change them back I get the error again.

I have tried deleting and recreating the step, and the variable, and using different names for them. Something is very jiggy with this variable!!

Variables names are case sensitives; make sure you are using the proper casing and that the variable is defined in the right scope.

|||

Can you share the package?

|||

I have discovered that the problem lies not in the Row Count task, but somehow in the Script task that immediately follows it.

I still haven't been able to isolate the issue, but for some reason the error is showing as related to the Row Count task.

(That is why I had been unable to shake the error despite deleting and re-creating the task.)

The script is unexceptional. It is simply incrementing a counter to generate a new row id. For some reason it is using the row count, but since the row count in my present tests is 0 the script should not be executing at all, and the error is not an execution error.

In answer to the suggestion above, the yes the case of the variable name is correct. The steps are all passing validation (no little red circles with x's in them) but failing at runtime.

Dylan.

|||Do you have the variable you are referencing in the Row Count marked as read or read/write in the script component? If so, the issue may be that the variable is locked when the Row Count tries to access it.|||

I have removed the variable altogether from the script step, as I realised on reflection that it really wasn't necessary there.

This really was confounding behaviour, however. The way in which the row count step was flagged in error made it tricky to diagnose what was wrong, so I hope that this thread helps out someone else.

I was unable to determine why the script step was having trouble with the variable. I suspect that the engine was trying to run both count and script at the same time, and there was contention for the variable. The variable was read-only in the script step, however.

Anyway, now onto the next issue...

Persistant VariableName error in Row Count task

I am getting this error:

The variable "MyVariable" specified by VariableName property is not a valid variable. Need a valid variable name to write to.

This is my scenario:

I had a Row Count task on a data flow that was writing to a locally scoped variable (called MyVariable for this example.)

I needed to access the value of this variable at the Control Flow (global scope), so I deleted it and recreated it at that level.

My new variable has the same name as the old variable, just different scope.

Now I get this error every time I run the package.

BUT WAIT THERE'S MORE!

I have another Row Count step in the same data flow that is presently writing to a globally scoped variable called "ErrorRows."

If I change this step to write to MyVariable it works fine. If I change my other step to use ErrorRows, it works fine. If I change them back I get the error again.

I have tried deleting and recreating the step, and the variable, and using different names for them. Something is very jiggy with this variable!!

Variables names are case sensitives; make sure you are using the proper casing and that the variable is defined in the right scope.

|||

Can you share the package?

|||

I have discovered that the problem lies not in the Row Count task, but somehow in the Script task that immediately follows it.

I still haven't been able to isolate the issue, but for some reason the error is showing as related to the Row Count task.

(That is why I had been unable to shake the error despite deleting and re-creating the task.)

The script is unexceptional. It is simply incrementing a counter to generate a new row id. For some reason it is using the row count, but since the row count in my present tests is 0 the script should not be executing at all, and the error is not an execution error.

In answer to the suggestion above, the yes the case of the variable name is correct. The steps are all passing validation (no little red circles with x's in them) but failing at runtime.

Dylan.

|||Do you have the variable you are referencing in the Row Count marked as read or read/write in the script component? If so, the issue may be that the variable is locked when the Row Count tries to access it.|||

I have removed the variable altogether from the script step, as I realised on reflection that it really wasn't necessary there.

This really was confounding behaviour, however. The way in which the row count step was flagged in error made it tricky to diagnose what was wrong, so I hope that this thread helps out someone else.

I was unable to determine why the script step was having trouble with the variable. I suspect that the engine was trying to run both count and script at the same time, and there was contention for the variable. The variable was read-only in the script step, however.

Anyway, now onto the next issue...

Persist ConnectionString

Hello All,

I have changed connection string property of connectionmanger at runtime and saved package.But my new connectionstring is not persisting, i am getting my old connection string after reload package .

ConnectionManager cm = package.Connections[test.ConnectionManagerID];

cm.ConnectionString = @."C:\Test.csv";

app.SaveToDtsServer(package, null,

@."File System\Dupaco Load Next Best.dtsx", "CIRCLE");

How can I save new connection string?.

Please help me.

Thanks

Subin

The ProtectionLevel property of the ConnectionManager will change what and if sensitive information is saved.

Personally I do not like saving sensitive information in a package, I much prefer using configurations. This allows you to keep such information externally, and just by changing the configuartion information between environments you can easily manage this. This mechanism is obviously great for when moving packages between test and production environments for example, but it scales right down to the developer's desktop, so you use the same mechanism throughout.

Monday, February 20, 2012

Permission for a newly created user

I have created a login that belongs to both Public and
db_datareader database role to a specific database.
However, when I open the property of that newly created
user and select "List only objects with permissions for
this user". It is blank.
On the other hand, when I connect to QA with that user, I
am able to run SQL Script.
Is there anything wrong ? OR It is correct that we are
not able to see the access right in EM ?Peter
db_datareader is intended for SELECT all data from any users tables
If you want the user to not be able to modify any data in users tables make
him a member of db_denydatawriter
fixed database role
"Peter" <anonymous@.discussions.microsoft.com> wrote in message
news:7c4801c5282d$0b0b3390$a601280a@.phx.gbl...
> I have created a login that belongs to both Public and
> db_datareader database role to a specific database.
> However, when I open the property of that newly created
> user and select "List only objects with permissions for
> this user". It is blank.
> On the other hand, when I connect to QA with that user, I
> am able to run SQL Script.
> Is there anything wrong ? OR It is correct that we are
> not able to see the access right in EM ?|||No...nothing is wrong. You will see the permissions
explicitly granted to the user when viewing the permissions
from Enterprise Manager, users. You won't see the
permissions the user has based on membership to the role.
-Sue
On Sun, 13 Mar 2005 16:30:37 -0800, "Peter"
<anonymous@.discussions.microsoft.com> wrote:

>I have created a login that belongs to both Public and
>db_datareader database role to a specific database.
>However, when I open the property of that newly created
>user and select "List only objects with permissions for
>this user". It is blank.
>On the other hand, when I connect to QA with that user, I
>am able to run SQL Script.
>Is there anything wrong ? OR It is correct that we are
>not able to see the access right in EM ?

Permission for a newly created user

I have created a login that belongs to both Public and
db_datareader database role to a specific database.
However, when I open the property of that newly created
user and select "List only objects with permissions for
this user". It is blank.
On the other hand, when I connect to QA with that user, I
am able to run SQL Script.
Is there anything wrong ? OR It is correct that we are
not able to see the access right in EM ?
Peter
db_datareader is intended for SELECT all data from any users tables
If you want the user to not be able to modify any data in users tables make
him a member of db_denydatawriter
fixed database role
"Peter" <anonymous@.discussions.microsoft.com> wrote in message
news:7c4801c5282d$0b0b3390$a601280a@.phx.gbl...
> I have created a login that belongs to both Public and
> db_datareader database role to a specific database.
> However, when I open the property of that newly created
> user and select "List only objects with permissions for
> this user". It is blank.
> On the other hand, when I connect to QA with that user, I
> am able to run SQL Script.
> Is there anything wrong ? OR It is correct that we are
> not able to see the access right in EM ?
|||No...nothing is wrong. You will see the permissions
explicitly granted to the user when viewing the permissions
from Enterprise Manager, users. You won't see the
permissions the user has based on membership to the role.
-Sue
On Sun, 13 Mar 2005 16:30:37 -0800, "Peter"
<anonymous@.discussions.microsoft.com> wrote:

>I have created a login that belongs to both Public and
>db_datareader database role to a specific database.
>However, when I open the property of that newly created
>user and select "List only objects with permissions for
>this user". It is blank.
>On the other hand, when I connect to QA with that user, I
>am able to run SQL Script.
>Is there anything wrong ? OR It is correct that we are
>not able to see the access right in EM ?

Permission for a newly created user

I have created a login that belongs to both Public and
db_datareader database role to a specific database.
However, when I open the property of that newly created
user and select "List only objects with permissions for
this user". It is blank.
On the other hand, when I connect to QA with that user, I
am able to run SQL Script.
Is there anything wrong ? OR It is correct that we are
not able to see the access right in EM ?Peter
db_datareader is intended for SELECT all data from any users tables
If you want the user to not be able to modify any data in users tables make
him a member of db_denydatawriter
fixed database role
"Peter" <anonymous@.discussions.microsoft.com> wrote in message
news:7c4801c5282d$0b0b3390$a601280a@.phx.gbl...
> I have created a login that belongs to both Public and
> db_datareader database role to a specific database.
> However, when I open the property of that newly created
> user and select "List only objects with permissions for
> this user". It is blank.
> On the other hand, when I connect to QA with that user, I
> am able to run SQL Script.
> Is there anything wrong ? OR It is correct that we are
> not able to see the access right in EM ?|||No...nothing is wrong. You will see the permissions
explicitly granted to the user when viewing the permissions
from Enterprise Manager, users. You won't see the
permissions the user has based on membership to the role.
-Sue
On Sun, 13 Mar 2005 16:30:37 -0800, "Peter"
<anonymous@.discussions.microsoft.com> wrote:
>I have created a login that belongs to both Public and
>db_datareader database role to a specific database.
>However, when I open the property of that newly created
>user and select "List only objects with permissions for
>this user". It is blank.
>On the other hand, when I connect to QA with that user, I
>am able to run SQL Script.
>Is there anything wrong ? OR It is correct that we are
>not able to see the access right in EM ?