Source table filtering in DTS by target table values.



Hi,
I am new to SQL Server and to DTs. I have to design a DTS package for
the following situation and I am not able to decide how to design it.

I need to do source filtering based on the destination table's rows
values.

There is System A with IBM DB2 running on AS/400.
There is System B with SQLServer on Windows.
System B is for CRM purposes. and A is for accounting.

There is a Client_master_A table in dB2 ( for system A) and
a client_master_B table ( for system B ) in SQLServer database.

Client_master_A contains data for accounting clients as well
as CRM clients So it has the clients in Client_master_B as
well as other non-CRM clients.


When an existing client's details are changed, that is
when the rows of client master have to be changed, the change is
made in System A. The 2 systems have to be brought in sync
for the client master.
This is done by a Java Application which takes list
of client_ids in client_master_B, gets data from client_master_A
only for these client Ids and updates client_master_B.
Client IDs are stored in a Java Arraylist.


Since this takes place in a loop, and involves record by record
processing, we want to do this thru DTS.


The problem is getting the list of B's client IDs for making
the SELECT SQL stmnt to get data from A's table.


Also, we cannot make a new table in A where
we can store/maintain/update B's client IDs.

I want to know how to solve this problem.


I am thinking of using a lookup table while transferring rows, or using

a DDQT (Data driven Query task) and filtering the source rowset
in system A or using at last resort using a ActiveX script.


Using an ActiveX script is not very acceptable as I have
never programmed in that before and that will result in buggy code.
Also row by row processing will slow down the data transfer which is
the problem that we are trying to solve.


Apart from the fact that the two databases are separate
and on separate machines, there is also the factor that
we cannot hard code the client IDs in theSQL query,


When we tried took the SQL made by the Java application
for extracting data from A, and ran it on DB2, there was
a error of "Max size of 2048 characters reached.....Exceeding limit
of variable, literals, constants in string". The client list is quite
long and so we got this error. So running the SQL directly is also
out of question.

My PM suggests that we can take the client Id list chop it into
small "batches" and then build the SQL query and execute it
in DB2 and transfer data to SQL server.
Can anyone tell me how to do this with the Package Designer.

Can a global variable solve this problem like populate a globa
lvariable with
client IDs from Client_master_B and then loop through Client_master_A
and transfer the matching rows only into Client_master_B.

Last, if nothing works, can I transfer the client IDs to a temporary
file ( created in the DTS package) and add them batch by batch
to DB2's SQL. Returned data will go to SQLServer by DTS via
a data transform task.


We want to call this DTS package thru a stored procedure, so that
data transfer can be initated from any client machine. The packag will
be stored in server machine of SQL Server and the relevant drives
will be installed on that machine itself.


Thanks,
Hemant.

.



Relevant Pages

  • Re: connect to named instance w/ non-default port
    ... SQL Native Client Configuration. ... An error has occurred while establishing a connection to the server. ... under the default settings SQL Server does not allow remote connections. ...
    (microsoft.public.sqlserver.connect)
  • Re: Problems connecting to SQL Server
    ... I am a complete newbie when it comes to SQL, ... I can not connect from this machine to the SQL Server. ... You should not need to know the sa password to install the ODBC driver. ... Client software. ...
    (microsoft.public.sqlserver.clients)
  • Re: SQL Mobile - cant replicate anymore?
    ... >> replicating data between SQL Mobile on my pda and SQL Server 2000. ... the replication process fails on the client. ...
    (microsoft.public.sqlserver.ce)
  • Re: Cannot connect a remote sql server
    ... Try disabling the firewall on the client. ... I would also make sure the SQL Browser service is running and that the login credentials you're using have rights to the default database. ... I've also written a long chapter on connecting that has helped a lot of people establish and maintain connections. ... I don't know if this matter but the server I'm trying to connect to is SQL Server 2000. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: dts package and t log
    ... But isn't it possible to start a dts package and as the first step use some ... kind af statement to tell sql not to fill up ... > Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) ... > worth of t-log space. ...
    (microsoft.public.sqlserver.dts)