The ExecuteSQL task is meant to be doing the query you posted. Sure you
can hack the transform Data task to do it but this would be slow and not
what it was designed for.
It is rather like trying to put a screw into a wall with a hammer when
you have a screwdriver in the other hand. The screw would go into the
wall but at what cost? (adapted from Codd - badly)
If that really is the statement you are trying to execute then you
should be using the ExecuteSQL task. If you want to us another task
then sure you can hook up the Transform data task to pump to a lookup
which executes a proc taking values from the Source which in your case
would be a join between the two tables.
You could also use the DDQ task
Note the two tasks above would operate Row*Row and not be that
efficient.
Allan
[quoted text, click to view] "David Grant" <DavidGrant@discussions.microsoft.com> wrote in message
news:DavidGrant@discussions.microsoft.com:
> Thank your for your quick response, Allan.
>
> In fact, I am of the same opinion but at the office I've been asked to try
> to do the ETL process with as fewer Execute SQL Tasks as possible. Howerver,
> as the SQL code begins to differ from basic queries, Data Transformation
> Tasks seems uncapable to handle it. Not only would this include the "update
> from a join" query, but it also would contain "select from select" queries.
>
> I know there's a better and quicker way but could I use the Data
> Transformation Task in that fashion?
>
>
> Greetings,
> David Grant
>
> "Allan Mitchell" wrote:
>
> > The Data Transformation Task?
> >
> > The statement you have just written would seem a perfect candidate for
> > the ExecuteSQL task.
> >
> > Why do you want to use another task?
> >
> > Is there more to it than this?
> >
> > Allan
> >
> > "David Grant" <David Grant@discussions.microsoft.com> wrote in message
> > news:David Grant@discussions.microsoft.com:
> >
> > > Hi to everybody!
> > >
> > > On using the Build Query option from the Data Transformation task, I' ve
> > > realized that the update query only allows updating a field with a scalar
> > > value.
> > >
> > > However I'm trying to use the Data Transformation Task for these kind of
> > > queries:
> > >
> > > UPDATE TableToUpdate
> > > SET C_FIELD_ID = ttj.C_FIELD2_ID
> > > FROM TableToUpdate ttu,
> > > TableToJoin ttj
> > > WHERE ttu.TYPE = ttj.C_ID
> > >
> > > Can I do this without using the Execute SQL Task?
> > >
> > > Thank you from beforehand.
> > >
> > > Greetings,
> > > David Grant
> > >
> > >
> >
> >