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)
 parameters ssis

Author  Topic 

inbs
Aged Yak Warrior

860 Posts

Posted - 2009-09-13 : 06:28:17
how can i use global variable in ssis?

i have this query
'select * from TABLEA WHERE TranDate>? and TranDate<?

the first @paramter1 is
--(Cast(DateDiff(Day,0,DATEADD(dd,-7,GetDate()))As DateTime))

--the second @paramter2 is GetDate()

i use OLEDB Source and OLEDB Destination

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-09-13 : 14:03:48
you can create ssis variables from variables window. its avialble from view -> variables from top menu. if you want to make it based on expression just give evaluate as expression property as true and give your expression inside expression builder.
Go to Top of Page

inbs
Aged Yak Warrior

860 Posts

Posted - 2009-09-14 : 01:09:09
how can i get the parameter from table?

instead -7 i want @day --i get it from table

DECLARE @day int
SET @day = SELECT DayParamter FROM TABLEA WHERE..

*(Cast(DateDiff(Day,0,DATEADD(dd,@day,GetDate()))As DateTime))
Go to Top of Page

YellowBug
Aged Yak Warrior

616 Posts

Posted - 2009-09-14 : 05:21:08
Use the Execute SQL Task Control Flow item.
In the editor
- set the SQLStatement to be a stored procedure or SELECT statement
- in the parameter mapping tab, set the variables
http://technet.microsoft.com/en-us/library/ms141003(SQL.90).aspx

Or you can use the script component.

Hope this is clear. I find it difficult sometimes to explain SSIS without pointing and waving my hands :-)
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-09-14 : 11:48:22
http://www.sqlis.com/post/The-Execute-SQL-Task.aspx
Go to Top of Page
   

- Advertisement -