dbTalk Databases Forums  

SSIS Variable

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


Discuss SSIS Variable in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Marko Praprotnik
 
Posts: n/a

Default SSIS Variable - 11-20-2006 , 02:16 AM






I'm new to SQL Server 2005 and I want to copy data from one db to
another db. For source data flow object i want to use OLE DB Source
Query bacause I want include variable in sql statement.
SELECT Name,Tag,DDate,
FROM ICRA_39_Dok
WHERE (DDAte = ?)

I have dat named package variable.

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

Default Re: SSIS Variable - 11-20-2006 , 06:09 AM






Hello Marko,

If I get the question you are asking about parameterising the SourceSQLStatement
for an OLEDB Source Adapter. If this is correct then it is quite simple

Start with the statement you have as the Command Text.
Now hit the Parameters Button to the right of the box.
Now map the variable containing the value you want to use as the filter to
the parameter.


Have you tried this already? Did you get errors?


Regards

Allan Mitchell
Konesans Ltd
T +44 7966 476 572
F +44 2071 008 479
http://www.konesans.com

Quote:
I'm new to SQL Server 2005 and I want to copy data from one db to
another db. For source data flow object i want to use OLE DB Source
Query bacause I want include variable in sql statement.
SELECT Name,Tag,DDate,
FROM ICRA_39_Dok
WHERE (DDAte = ?)
I have dat named package variable.




Reply With Quote
  #3  
Old   
Todd C
 
Posts: n/a

Default Re: SSIS Variable - 11-22-2006 , 09:01 PM



Another solution, though more complex than Allan's is to use a Script Task
that reads the Date variable, generates the SQL Text and assigns it to a
Read/Write variable. Then in the OLE Db Source, set the Type to Variable and
use the variable generated by the script.

I have used this method sucessfully inside a ForEach Sequence loop and build
some complex dynamic SQL strings from various variables.

When all else fails, get yourself a copy of Allan's book: "Professional SQL
Server 2005 Integration Services".

(Allan might be a bit partial to agree with me! ;-) )

It is very thorough.
--
Todd Chittenden


"Allan Mitchell" wrote:

Quote:
Hello Marko,

If I get the question you are asking about parameterising the SourceSQLStatement
for an OLEDB Source Adapter. If this is correct then it is quite simple

Start with the statement you have as the Command Text.
Now hit the Parameters Button to the right of the box.
Now map the variable containing the value you want to use as the filter to
the parameter.


Have you tried this already? Did you get errors?


Regards

Allan Mitchell
Konesans Ltd
T +44 7966 476 572
F +44 2071 008 479
http://www.konesans.com

I'm new to SQL Server 2005 and I want to copy data from one db to
another db. For source data flow object i want to use OLE DB Source
Query bacause I want include variable in sql statement.
SELECT Name,Tag,DDate,
FROM ICRA_39_Dok
WHERE (DDAte = ?)
I have dat named package variable.





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.