Link to home
Start Free TrialLog in
Avatar of yechan
yechanFlag for United States of America

asked on

Question about DTS syntax

Hi,

I am looking at an ActiveX script and I keep running into lines of code something like the following:

DTSDestination("comments") = DTSDestination("comments") + "  Some additional comments here."

How can this syntax be legal?  I mean, how does the server know what DTSDestination("comments") is prior to assigning it back to DTSDestination("comments")?

I suppose it must be ok since it has run like this for a while.  How can I convert this type of logic inside SSIS script component.

thanks
Avatar of Jason Yousef
Jason Yousef
Flag of United States of America image

Yes, that normal , here it's saying the column 'comments'  = the same column 'comments' + some additional comments.

example if the value in the comments table is "YECHAN"

so  comments =  comments + " Question #12324"

that will give you  "YECHAN Question #12324"
 


Ohh check that, there's an example in the middle of the page for column "AccountMonth"

http://msdn.microsoft.com/en-us/library/aa933459%28v=sql.80%29.aspx
Avatar of yechan

ASKER

the value of "DTSDestination("comments") " is from the destination table?  Assuming the destination table has records, how would it know which comment to pick?  

thanks
"comments" is the column name and it's row by row level.

Avatar of yechan

ASKER

what I mean is how would the computer know which row to pick?
it's processing each and every row, iterating over rows. reading row by row and adding that text to it.
ASKER CERTIFIED SOLUTION
Avatar of Jason Yousef
Jason Yousef
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Anthony Perkins
Actually I do see your point and taken out of context while legal does not make a lot of sense.  What I suspect you have is something like this:

DTSDestination("comments") = DTSSource("SomeColumn")
or even:
DTSDestination("comments") = "SomeValue"
...
And then:
DTSDestination("comments") = DTSDestination("comments") + "  Some additional comments here."

Or perhaps it is in a For loop as in:
For I = 1 to 10
    DTSDestination("comments") = DTSDestination("comments") + "  Some additional comments here."
Next
Avatar of yechan

ASKER

sorry for the drop off.  After working with DTS a little bit more, the answers really make much more sense.
You are welcome.