Wednesday, March 28, 2012

Newbie question activex transform

Hi,

This may be incredibly stupid question but how do you execute a sql
statement from within a dts transform data task.

I'm transfering data from one table to another one on the same
database on sqlserver 2000. Most of the rows are copy columns but some
require some manipulations done on them so I'm using activex tasks to
do it.

I have to filter on a part number. There can be more than one row in
the source table with the same part number and I need to select the
earliest date field from the table for that part number.

"select min(first_date_time) from table_name where [part number] = '"
& DTSSource("part Number") & "'"

This is the sql statement i use. It gets parsed correctly and the part
number gets correctly assigned into the statement.

However I have no idea how to execute the statement inside the activex
script and assign the value returned to a variable name to be used
later in the script.

Can someone enlighten me on if it can be done and if not how I amy
achieve a result by other means if it can't

Thanks.It's ok, I discovered what lookup queries are :)

On Sat, 06 Sep 2003 14:54:04 +0100, Mirth1314 <not@.ahope.net> wrote:

>Hi,
>This may be incredibly stupid question but how do you execute a sql
>statement from within a dts transform data task.
>I'm transfering data from one table to another one on the same
>database on sqlserver 2000. Most of the rows are copy columns but some
>require some manipulations done on them so I'm using activex tasks to
>do it.
>I have to filter on a part number. There can be more than one row in
>the source table with the same part number and I need to select the
>earliest date field from the table for that part number.
>"select min(first_date_time) from table_name where [part number] = '"
>& DTSSource("part Number") & "'"
>This is the sql statement i use. It gets parsed correctly and the part
>number gets correctly assigned into the statement.
>However I have no idea how to execute the statement inside the activex
>script and assign the value returned to a variable name to be used
>later in the script.
>Can someone enlighten me on if it can be done and if not how I amy
>achieve a result by other means if it can't
>Thanks.

No comments:

Post a Comment