Friday, 20 September 2013

FOR EACH LOOP in SSIS


FOR EACH LOOP CONTAINER  IN SSRS-2008R2

STEP1: Create source on windows Explorer

STEP2: Create multiple Text files inside source folder



STEP3: Create a package and add DATA FLOW TASK in control flow, and add a variable by right clicking outside the dataflow task and name it as filepath  .











STEP4: Name=filepath, Scope=package, data Type=String;









STEP 5: drag data flow task inside to For each loop.



















STEP 6: double Click on For Each Loop and choose collection -->Browse-->select Source Folder And press OK



STEP 7:  Select Filepath From drop down list then Click OK



STEP 8:  Add flat file source and OLE DB Destination , connect together





































STEP 9: DOUBLE click on flat file source then give connection name connection1 -->browse folder and any one text file inside it.




STEP 10: click on columns and it will show preview, and press OK 




 STEP 10: next go to COLUMNS and pres OK




STEP 11: Click on new and in the NEW WINDOW again NEW, then select server name and DATA SOURCE name -->test your connection -->press ok again OK.




STEP 12: name of the table or view: select a table from SSMS ,then go to mappings set columns then press ok



step 13: Now debug it.



No comments:

Post a Comment

EMP, DEPT Sample script

/****** Object:  Table [dbo].[DEPT]    Script Date: 19-05-2016 06:58:37 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET A...