dbTalk Databases Forums  

help with dts package?

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss help with dts package? in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
damon@soho-systems.com
 
Posts: n/a

Default help with dts package? - 03-07-2006 , 09:50 PM






Hoping that someone will throw the dog a bone here

I am trying to build a DTS package that will import all of the rows
that do not already exist from a mySQL database (via ODBC) to a MS SQL
database.

Like this

step1 - get the last incremented ID from the mssql table (not the mssql
ID, but an imported ID from the mySQL table)

set @nextrecord = select top 1 * from mssql.table
order by id,desc


step 2 - insert records from the mysql table with an ID higher than
the highest ID in the mssql table.

insert into mssql.table
select * from mysql.table
where ID > @nextrecord

so, as you can see, I have an idea what I want to do, but no clue how
to actually do it.

What I have done so far;

created a new DTS package
created the connection via a system DSN to mysql
created an execute SQL task
got lost....

anybody feeling charitable tonight?

thx!


Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: help with dts package? - 03-09-2006 , 04:33 PM






Hello damon (AT) soho-systems (DOT) com,


OK So using the ExecuteSQL task against a SQL Server Connection you can assign
the return value from

select top 1 * from mssql.table
order by id,desc

To an output parameter and therefore a variable?

You then have choice of using a parameterised statement to a DataPump task
against the MySQL Connection or if that is not supported you can build the
statement before and populate in a Script task. Have a look at this

http://www.sqldts.com/default.aspx?205


Allan Mitchell
www.SQLDTS.com
www.SQLIS.com
www.Konesans.com

Quote:
Hoping that someone will throw the dog a bone here

I am trying to build a DTS package that will import all of the rows
that do not already exist from a mySQL database (via ODBC) to a MS SQL
database.

Like this

step1 - get the last incremented ID from the mssql table (not the
mssql ID, but an imported ID from the mySQL table)

set @nextrecord = select top 1 * from mssql.table
order by id,desc
step 2 - insert records from the mysql table with an ID higher than
the highest ID in the mssql table.

insert into mssql.table
select * from mysql.table
where ID > @nextrecord
so, as you can see, I have an idea what I want to do, but no clue how
to actually do it.

What I have done so far;

created a new DTS package
created the connection via a system DSN to mysql
created an execute SQL task
got lost....
anybody feeling charitable tonight?

thx!




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.