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
Microsoft SQL Server

Avatar of undefined
Last Comment
Anthony Perkins
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"
 


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

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
yechan
Flag of United States of America image

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
Avatar of Jason Yousef
Jason Yousef
Flag of United States of America image

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

Avatar of yechan
yechan
Flag of United States of America image

ASKER

what I mean is how would the computer know which row to pick?
Avatar of Jason Yousef
Jason Yousef
Flag of United States of America image

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

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
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
yechan
Flag of United States of America image

ASKER

sorry for the drop off.  After working with DTS a little bit more, the answers really make much more sense.
Avatar of Anthony Perkins
Anthony Perkins
Flag of United States of America image

You are welcome.
Microsoft SQL Server
Microsoft SQL Server

Microsoft SQL Server is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.SQL Server is available in multiple versions, typically identified by release year, and versions are subdivided into editions to distinguish between product functionality. Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning.

171K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo