[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Question about DTS syntax

Posted on 2011-10-07
10
Medium Priority
?
234 Views
Last Modified: 2013-11-10
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
0
Comment
Question by:yechan
  • 5
  • 3
  • 2
10 Comments
 
LVL 21

Expert Comment

by:Jason Yousef, MS
ID: 36932745
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"
 


0
 
LVL 21

Expert Comment

by:Jason Yousef, MS
ID: 36932751
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
0
 
LVL 1

Author Comment

by:yechan
ID: 36932864
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
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 21

Expert Comment

by:Jason Yousef, MS
ID: 36932982
"comments" is the column name and it's row by row level.

0
 
LVL 1

Author Comment

by:yechan
ID: 36933027
what I mean is how would the computer know which row to pick?
0
 
LVL 21

Expert Comment

by:Jason Yousef, MS
ID: 36933047
it's processing each and every row, iterating over rows. reading row by row and adding that text to it.
0
 
LVL 21

Accepted Solution

by:
Jason Yousef, MS earned 2000 total points
ID: 36933077
Or whatever rows you're working on...so it'll iterate over these rows one by one.
 Such as cursors...but that's really a broad definition..

I would say the correct answer will be, it's working on row by row in the batch or the rows you're working on.

Also in DTS or SSIS, There are  many components and each one will depends on its nature.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 36934521
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
0
 
LVL 1

Author Comment

by:yechan
ID: 37014746
sorry for the drop off.  After working with DTS a little bit more, the answers really make much more sense.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 37018540
You are welcome.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
MSSQL DB-maintenance also needs implementation of multiple activities. However, unprecedented errors can hamper the database management. In that case, deploying Stellar SQL Database Toolkit ensures fast and accurate database and backup repair as wel…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question