Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 7,2000
»
Administration
»
Transformation VB Script
Transformation VB Script
Rate Topic
Display Mode
Topic Options
Author
Message
mykleisyomomma
mykleisyomomma
Posted Monday, November 23, 2009 3:12 PM
Forum Newbie
Group: General Forum Members
Last Login: Monday, November 23, 2009 3:11 PM
Points: 1,
Visits: 0
Hello,
I am using Microsoft SQL Server 2000 and need some slight help in importing and transforming some data.
Below is the auto-generated script from Microsoft:
"Function Main()
DTSDestination("Code") = DTSSource("Col001")
DTSDestination("User_Cancel1") = DTSSource("Col002")
Main = DTSTransformStat_OK
End Function"
The first DTSDestination is the primary key of the database, and already has data in it. I want the script to find all matches between "Code" and "Col001", and then update "User_Cancel1" with "Col002".
If I run the script as is, I am given an error that it cannot insert duplicate data into the table.
I just want the script to FIND the first variable, and then update the second variable in the row.
I assume it's easy but I don't know VB well.
Thanks in advance.
--Mike Matthews
Post #823544
spaghettidba
spaghettidba
Posted Tuesday, November 24, 2009 1:17 AM
SSCarpal Tunnel
Group: General Forum Members
Last Login: Thursday, May 16, 2013 8:29 AM
Points: 4,804,
Visits: 8,067
I don't think this is a good Idea, Mike. The code you put in the transformation script is run for each row in the source table, so it would have to connect to the destination data source and issue a query for each row read from the source table.
I would copy the whole source table into a temporary table in the destination database and then match the rows with a set based query.
Hope this helps
Gianluca
Get your two-cent-answer quickly
The Spaghetti DBA
Post #823716
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.