Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Approch For picking each value from the table and assign to package variable and use. Expand / Collapse
Author
Message
Posted Monday, February 11, 2013 8:01 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Friday, May 2, 2014 1:34 AM
Points: 20, Visits: 150
Hi all,

I have a requirement like, In my table have a data as shown below

Table:-

ID Tablename
---------------------------
1 Table1
2 Table2
3 Table3
.
.
.
N Tablen

I need a package to pick each tablename column value and assign that to variable and used it in next tasks in package.


Thanks



Post #1418454
Posted Monday, February 11, 2013 4:58 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 8:38 PM
Points: 7,107, Visits: 12,658
You can select values from your table into a Variable of Type Object using an Execute SQL Task. Then you can iterate over that Variable using the ForEach Loop Container (FELC) setup with an Enumerator of type Foreach ADO Enumerator. The FELC can assign each column in the resultset to a different variable so you can work with variables that contain the name and id in Tasks contained within the FELC.

__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Post #1418688
Posted Monday, February 11, 2013 11:25 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Friday, May 2, 2014 1:34 AM
Points: 20, Visits: 150
Thanq very much for you approch, It work for me
Post #1418759
Posted Tuesday, February 12, 2013 7:58 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 8:38 PM
Points: 7,107, Visits: 12,658
You're welcome. Thanks for the feedback.

__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Post #1418983
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse