Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 Read Write Same Variable in script task

Author  Topic 

mauler05
Starting Member

17 Posts

Posted - 2007-11-01 : 15:11:09
I want to write a variable say testVar in PostExecute of my script. I also want to read the same variable at the start of my script block.

How to specify this variable in the script transformation editor

ReadOnlyVariables = ????
WriteOnlyVariables = ???

If i just define

WriteOnlyVariables = testVar

will it work . I mean i cannot use testVar in both read & write


Any suggestions...


Thanks



X002548
Not Just a Number

15586 Posts

Posted - 2007-11-01 : 15:27:07
Is this for SSIS?

What are you trying to accomplish?



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

mauler05
Starting Member

17 Posts

Posted - 2007-11-01 : 15:52:33
Yes this is for SSIS. Actually this script is inside a For each Loop container. I am reading on a row by row basis and i have to check if couple of IDs in the current row is same as previous row and based on that i have to create a new transaction

So i have created 2 variables in SSIS and i am writing these 2 variables in the PostExecute() with my current Row values.

Thus what i need at the start of my script block is to read these values and when my next row comes just compare it.....

Hope it make sense :)

But i cannot use same varaible name in both Read & Write Variable in script transformation editor



Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2007-11-02 : 09:01:53
quote:
Originally posted by mauler05

I am reading on a row by row basis and i have to check if couple of IDs in the current row is same as previous row




How do you determine what "previous" is, since the order of data in a database has no meaning



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page
   

- Advertisement -