condition on two oledb sources

  • Hi

    My requirement is like,

    select emp.eno,sal from company1

    where sal>(select max(sal) from company2)

    How to do the above sql statement with two oledb sources and there is no common column on both the tables....

  • 1) Create a Double variable to hold the result of executing the max sal query

    2) Create a String variable to hold your variable SQL.

    3) Run an Execute SQL task to get the max sal and assign it to variable 1.

    4) Assign your dynamic SELECT statement to variable 2, using variable 1 (which has been assigned the max salary)

    5) Create your OLEDB source with Data Access Mode 'SQL command from variable' and select variable 2 from the drop-down list.

    OK, that's a bit terse, but hopefully it will get you started.

    Phil


  • sql query having more than 4000 charecters so the query cannot be stored in variable...

    so please give me any other solution...

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply