Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 3 sources

Author  Topic 

inbs
Aged Yak Warrior

860 Posts

Posted - 2008-11-16 : 12:45:30
i asked before and i still do not know the answer:

source_1: Excel file.
source_2: table_A in DB
source_3: constant parmaters:( like ,'Snow',100,GetDate().)

now,i want to make join of three of them.

i make join between Excel_file and table_A by "Merg Join"
But how i add the constant parmeters?

thanks a




visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-11-16 : 23:24:47
1.Use Excel Source
2.Use OLEDB source
3.Decalre three variables to hold the constant values. Let them be var1,var2,var3.Set them to your values (snow,100,getdate()). for setting getdate you want to set expression property to true and set getdate value in expression window.
Declare a fourth string variable to form query string let it be SQL. Give evaluate as expression property as true for variable SQL from properties window. Click the ... next to expression property and set expression as

"SELECT " +(DT_WSTR,30)@[User::var1] +" AS Col1,'" + @[User::var2] +"' AS Col2,'"+ (DT_WSTR,30)@[User::var3] + "' AS Col3"
this will give you three columns as output with your values.
Then add a OLEDB source task. give SQL command from variable as source and map it to variable SQL. then it will return the three columns (you can view it in preview tab).
Finnaly connect all the three tasks to Merge join task and select appropriate columns.
Go to Top of Page

inbs
Aged Yak Warrior

860 Posts

Posted - 2008-11-18 : 03:22:09
i stil didnt do it,but i will.

what i will do with "CASE" statment in query?
(how i do it?)
Go to Top of Page
   

- Advertisement -