Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Read A Table Row Into A Variable 1

Status
Not open for further replies.

Skittle

ISP
Sep 10, 2002
1,528
US
I would like to read a single row table from SQL Server into a SSIS package variable. I want to use the variable as part of an expression in a container. I know I could set it as a configuration parameter but I don't want to go down that route if I can avoid it.

Can anybody suggest a way of doing this?


Dazed and confused
 

1. create a variable

>Define a variable 'var1'
>Datatype as 'object'
>Value as 'System.Object'

2. Right Click Execute SQL Task
and choose EDIT

General TAB
SQLSourceType : Direct input
SQLStatement : Select 'column1' from 'Table1'

Result Set TAB
>set 'Result Name' to 0
>set 'Variable Name' to user::var1


In your For EaCh Loop Container,
choose :
>ForEach ADO Enumerator
and
>user::var1 as ADO source variable

Hope this helps

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top