dbTalk Databases Forums  

Multiple Source Connections

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


Discuss Multiple Source Connections in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Chris White
 
Posts: n/a

Default Multiple Source Connections - 07-06-2003 , 12:54 AM






I've got a package that imports records from Access to SQL Server. I want
just new records. Here's the source from the Transform:

select * from Products where Code > '10357'

I want the code to come from the Destination table, ie.
select * from Products where Code > (Select MAX(Code) from [dbo].[Products])

How do I do this?

Thanks,
Chris



Reply With Quote
  #2  
Old   
Chris White
 
Posts: n/a

Default Re: Multiple Source Connections - 07-06-2003 , 02:23 PM






Thanks,
I'm using 2000 and method 2 worked great.

"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote

Quote:
OK So you want to take records from the Access table to SQL Server only
whee
the records in the Access table have a > Code than those already in SQL
Server.

2 methods

1. Linked server and use that in your SourceSQLStatement
2. In 2000 use an ExecuteSQL task and assign to it the value of Select
MAX(Code) from [dbo].[Products]) executed on the SQL Server connection.
Now
in the SourceSQLStatemen you can assign that to the records from Access

SELECT <field list> FROM Table WHERE Code > ?

(? being the parameter that will be substituted at runtime)

--


Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org




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.