How To Move The Bad Data Into Another Directory While Looping Through A Set Of FLAT FILES ?

Sep 1, 2007

Currently looping through the set of flat files like CHK0604, CHK0611, CHK0618, and CHK0625 from the source folder C:SOURCE



OBJECTIVE within the flat file if any records/rows cause error i have to move the bad data into separate folder C:ERROR



STEPS TAKEN

1) In FOREACH LOOP component i specified the variable User:: sourceFilePath for my source file CHK0604 etc. location C:SOURCE. The loop walkthrough each file in C:SOURCE and if no error then moves the flat file into another folder C:ARCHIVED. This task is perfectly working.



2) Within the dataflow I am diverting the the bad rows from "conditional component" into "Flat File Destination" Component.



3) "Flat File Destination" Connection manager i set the expressions as @[User:: sourceFilePath] +"_Error.TXT".



ISSUE

Because of point (3) the error file is created in the SOURCE flat file location C:SOURCE.



QUESTION



1) My error file name should be CHK0604_Error, CHK0611_Error, CHK0618_Error, CHK0625_Error created in another folder C:ERROR.



2) How to move the bad data into another directory while looping through a set of FLAT FILES ?

3) If i have to create another variable like @[User:: ErrorFilePath] where to create ? How to use the source file title as the title of error file.?

Thanks for the help

View 4 Replies


ADVERTISEMENT

Move Files From Directory Based On Names On A Static List.

May 2, 2008

I have a scenario where I need to move a series of files from within a directory of many files. The files follow no nameing convention and are more of less random. However the file names never change from week to week. I tried various different options in a 'file system task', no go.
Any ideas on how to move only a list of files?

or

can I load only specific files into a 'Foreach Loop container' from a certain directory. I tried delimiting file names in the file source, that did not work.

Either way can work,
Thanks

View 1 Replies View Related

How To Archive The Flat Files After They Are Loaded Into A Directory

Aug 21, 2007

I have to archive the Flat files after they are loaded into an archive folder with a Date time stamp on the folder in the format mmddyyyyhhmmss what task should i use in ssis to complete this and can i do this task for multiple files in the directory, how should i configure such that all files are archived and placed in one directory with a current timestamp, Please Provide me with a solution

View 11 Replies View Related

Looping Through Data And Outputting Text Files

Mar 20, 2008

I have this following code here...






Code Snippet

SET @SQL = 'Select * FROM IdentipassNew.dbo.CBORD_Interface_Final'
SET @BCPBody = 'bcp "' + @SQL + '" queryout "d:smartcardcbordudfcbordbody.txt" -T -fc:cpbody.fmt'

Problem is, there is over 85,000 records in that set and that is too big for the text file, so I was wondering if it would be possible to select like 30,000 records output those to a text file, then select the next 30,000 and create another file, then finally get the remaing records and put that in another text file. Can someone point me in the right direction as to how to accomplish this?


Thanks in advance.

View 3 Replies View Related

How To Move Data Files

Jul 20, 2005

hello,my problem is how to move data files drom drive c: to drive d: ??--MarcinS

View 1 Replies View Related

Need To Move Data And Log Files To A Different Drive?

Jul 3, 2001

View 1 Replies View Related

Move Files In Data Flow

Sep 7, 2007



Hi all,

I'm trying to find some way to implement a move file task in my Data Flow. I parse through a flat file, retrieve a value, then I'm using a lookup table to check if that value exists in a table... if the value doesnt exist, I need to move this file to a new directory and insert the value into a different table. Does anyone have any ideas about how to move the file while using the Data Flow pane?

Or is there some way to pass information from the look up table to the Control flow pane and use the Move File Task there? I'm trying to stay away from a Script task or a Script component unless it's unavoidable. I appreciate any ideas!

View 6 Replies View Related

New Install, But I Need To Move Data Files

Apr 26, 2007

I could really use some help on this one. I know virtually nothing about SQL Server. We installed this because our database for the application we're running (Lexis Nexis Time Matters) had gotten too large for the Express 2005 version. We've also installed a new version of the software, and on a new server.

The new server has the drive partitioned into two partitions. When installing the application, I selected drive D (545 gb) as the data drive, but when I installed SQL server, it was installed on drive C (12 gb). I did not realize that the the application data was simply configuration information, and the data for the program is actually being installed on the C drive (Program FilesMicrosoft SQL ServerMSSQL.1MSSQLData).

Is there a simple procedure to move this data, including the SQL instance (TIMEMATTERS) to the D drive? Or should I uninstall and start over?

View 1 Replies View Related

Move Distribution Data/log Files To Another Drive

Jun 20, 2007

I haven't found the definitive answer on how or if this can be done without removing replication. I'm thinking ALTER DATABASE modify_file is the way to go. Anybody know if this will work or a better way to go about it?

Thanks

View 2 Replies View Related

Compare Fields-two Flat Files-load Data

Jul 13, 2007

Hi All,



I am totally new to SSIS and im in the learing phase. I have a requirement as below,

I have two flat files (mainframe files), the structure i have given below,

File1:



070113

12345johnk

23456james



1st row is header record which has got date in YYMMDD format and remaining rows have emp no and emp name



File2:

070113

070113

070113

070113



contains 4 records which are dates.



The requirement is to compare the header date in file1 with the 4 dates in file2, if they are equal then it should load all the records in file1 except the header into a table and if they donot match then it should log an err msg. Please could someone provide a lead on this.



The files have same record length and fixed field delimited.



Thanks in advance

raj

View 1 Replies View Related

Problem In Maintaining Data Precision During Import From Flat Files.

Nov 19, 2007



In my scenario I have about a dozen of flat files (Text files),that I have to import in SQL Server 2005.
I am using Flat File connection manager to carry out tha task.Flat files contains data generated from oracle.
When I import data from these text files into SQL ,the main problem lies in converting number(p,s) data type column of Oracle(In text file) to numeric(p,s) data type of sql server 2005.

Number(p,s) data type looses all it's digits after decimal to zero during import process.
For example

1.2434234390 (from text file,number(p,s) type of oracle) converts to 12.0000000000 (numeric(p,s)) of sql server 2005.

Is this this any workaround to this problem.I urgently need help.



View 7 Replies View Related

Doing A Data Import Using DTS Wizard In SQL Server 2005 - Being Efficient With 5 Flat Files

Apr 13, 2006

Hi,

I'm a new user of SQL Server 2005. I have the full version installed. I also have SQL Server Business Integration Dev Studio installed. My OS is Windows XP.

I'm importing a series of 5 flat files into a database on one of the SQL Servers we have. My goal is to get 5 different tables (though perhaps I should do one and add an extra field to distinguish each import) into the database for further analysis.

I tried doing an import via DTS Wizard. There are no column names in the flat file so I defined them during the import process (all 58 of them). When I got to the end, I had an option to save the import process as a SSIS (SQL Server Integration Service) Package on:

SQL SERVER (I don't have permission for this)

or

FILE SYSTEM (did this one)

I saved the Package locally in hopes of being able to go back in, change the source file and destination table of the package and quickly get the other 4 flat files imported.

My problems are:

1) I couldn't find how to run the *.DTSX Package file to run in SQL Server Studio (basically reuse the Package with minor changes and saving me having to redefine the same 58 columns on each flat file import)

2) Tried but didn't understand how to run it in SQL Server Bus Intel Dev Studio (i.e. understanding the mapping and getting the data types right so it wouldn't error out)

3) Don't know how to make the necessary changes so that the Package handles the next source file and puts in a new destination table (do I need to do 5 CREATE TABLES so this Package has a place to run to?)

4) Does the Package need to be part of a Project to run (I haven't found how to take an existing Package and make it part of a Project/Solution)?

5) Is there a good book or online resource for just getting the basics of using SQL Server 2005 and SQL Server Business Intelligence Development Studio?

I'm really at a loss after spending a day fruitlessly on it scouring the help files, forums and experimenting around.

Hope somebody can point me in the right direction.

Regards,

Patrick Briggs,
Pasadena, CA


View 7 Replies View Related

Doing A Data Import Using DTS Wizard In SQL Server 2005 - Being Efficient With 5 Flat Files

Apr 18, 2006

I just spent some time working out how to do a seemingly simple task. I€™m sharing the steps I took to do this in hopes it saves other SQL Server 2005 users (especially newbies like myself) time.

My original question posed on several SQL newsgroups was based on this goal:


I'm importing a series of 5 flat files (all with same file layout) into a database on one of the SQL Servers we have using SQL Server 2005 (SQL Server Management Studio) . My goal is to get 5 different tables. I want to do this without having to redo all the layout criteria 4 additional times.

Below are the steps I followed to get a solution (all done in Microsoft SQL Server Management Studio):

Create the Package (data import)

1) Use the SQL Server Import Export Wizard (equivalent to SQL Server 2000 Data Transfer Wizard) to import your first flat file. At the CHOOSE DATA SOURCE window browse for your file.
2) Under the Advanced tab, you can set your Column attributes (€œoutput column width€? or €œdata type€? to name a few). I highlighted all the columns and selected €œstring [DT_STR]€? for data type. To avoid truncation errors, I selected 255 for output column width. You can name the columns whose data you are most concerned with (I did import all the available fields).
3) After choosing a server destination you will have a €œSELECT SOURCE TABLES AND VIEWS€? window pop up. Under the €œMapping€? column you can choose to tweak your mapping further editing in SQL (see Edit SQL button). I didn€™t.
4) The €œSAVE AND EXECUTE PACKAGE€? will pop up. The €œExecute Immediately€? box should be checked and you should check the €œSave SSIS Package€? (SQL Server Integration Services). When you do, select €œFile System€? for where to save this import-file-package to.
5) Click OKAY for the Package Protection Level and the €œSAVE SSIS PACKAGE€? window will appear. Browse for a path on your local computer to save to.

Modify Package (data import) for Next Use

6) In SQL Server Management Studio, browse for the Package and open it.

Preparation for SQL Task €“ box

7) You should see a screen that shows two boxes (€œPreparation for SQL Task€?) and (€œData Flow Task€?).
8) Right click on the former and select €œEdit€?.
9) On the €œSQL Statement€? row, click into the right column and select the €œ€¦€? box
10) Change the destination table (the table you will create with this package) to a meaningful name and click OK.
11) Click OK for the €œSQL Task Editor€?

Data Flow Task - box

12) Right click on the €œData Flow Task€? box and select €œEdit€?.
13) Three boxes will appear €œSourceConnectionFlatFile€?, €œData Conversion 1€?, and €œDestination - <whatever table name your original data import went to>€?. Below them is a section that displays €œConnection Managers€?

SourceConnectionFlatFile - editing

14) The first thing you will want to do is change the import source to a new flat file. You do this by going below the boxes under the €œConnection Managers€? window and right clicking on €œSourceConnectionFlatFile€? and then selecting €œEdit€?
15) Browse for the new €œFile Name€? and select it.
16) A €œMicrosoft SQL Server Management Studio€? window will pop up asking you if you want to €œkeep or reset the existing metadata€?. The metadata is just your column definitions and choosing €œYES€? to keep this makes sense if you are doing data imports on files with the same file layout.
17) Still in the €œFlat File Connection Manager Editor€? window, change the €œConnection Manager Name€? to something meaningful (I add <_> at the end and then the name of the table the flat file is going to) and click OK.

SourceConnectionFlatFile €“ box (editing)

18) Right click on the €œSourceConnectionFlatFile€? box and select €œEdit€?.
19) Your newly named €œFlat File Connection Manager€? should appear in select box.
20) Click OK, right click again on the €œSourceConnectionFlatFile€? box and select €œShow Advanced Editor€?.
21) Under the €œConnections Manager€? tab, your newly named €œFlat File Connection€? should appear (the prior step is necessary for the advanced editor to recognize your change).
22) Under the €œComponent Properties€? tab, on the €œName€? row, click into the right column and rename to something meaningful (notice the €œIdentification String€? row description changes too once you click out of the €œName€? row)
23) Under the €œColumn Mappings€? tab, just confirm you are mapping your flat file fields (€œAvailable External Columns€?) to a destination table€™s fields (€œAvailable Output Columns€?).
24) Under the €œInput and Output Properties€? tab you can check in €œFlat File Source Output€? to make modifications to either your €œExternal Columns€? or your €œOutput Columns€? €“ you shouldn€™t need to for a simple import.
((NOTE: any changes you make here would likely need to be consistent with the column properties found under the €œConnection Manager Window€? for the €œSourceConnectionFlatFile€? as well as the €œData Conversion 1€? box under the €œData Flow Tasks€? window, so exercise caution
25) NOTE: This process has worked for me by making my source columns all €œstring [DT_STR]€? data type and the output columns all €œUnicode String [DT_WSTR]€? data type.

Data Conversion 1 €“ box (editing)

26) There is nothing you need to do here. By right clicking on the €œData Conversion 1€? box and selecting €œEdit€?, you can see and change the data type of the output columns (the ones in the table your importing the flat file to). There are probably more edits one can do but they€™re beyond what I€™ve learned.

Destination - <whatever table name your original data import went to> €“ box (editing)

27) Right click on the €œDestination - <whatever table name your original data import went to>€? box and select €œShow Advanced Editor€?.
28) Select the €œComponent Properties€? tab.
29) Select the right column at the €œName€? row and change the name to something meaningful (ie. related to the source file name or the table name you€™re importing to).
30) Select the right column at the €œIdentification String€? row and it will update to this change.
31) Select the right column at the €œOpenRowSet€? and change it to the name of the table you are importing your flat file to (this should be consistent with table name under step 10).
32) Click OK
33) Select FILE and select €œSave As€¦€? and then give your package a new name that€™s meaningful (this will be helpful if you have to rerun the import of the flat file later).

Run (execute) the Revised Package (data import)

34) Go back to SQL Server Management Studio and open the Object Explorer
35) Connect to an €œIntegration Services€? component. This should essentially be a local instance (not sure where it is on the local computer or in SQL Server Management Studio on the local computer).
36) In €œObject Explorer€? go down to your €œIntegration Services€? object and expand it.
37) Expand €œStored Packages€?
38) Right click on €œFile System€? and select €œImport Package€? and an €œIMPORT PACKAGE€? window will appear
39) For €œPackage Location€? choose €œFile System€? and then browse for the €œPackage Path€?
40) Click into the €œPackage Name€? and it defaults to your Package€™s file name.
41) Click OK and the Package is imported.
42) Right click on the newly imported Package and select €œRun Package€?
43) An €œExecute Package Utility€? window appears
44) Select €œExecute€? and the package runs.

View 1 Replies View Related

How To Move Server Root Directory To Another Partition?

Apr 18, 2000

I want to move the SQL Server 7.0 root directory from C:MSSQL7 to D:MSSQL7 (same host). I see the startup parameters under server properties could be changed to point to the new location, but Master has the paths to all the databases recorded in sysdatabases table, so at least that would have to change, and sysdevices table points to files on C:. And maybe the NT registry points to some files there too. Anyway, is there some established method to move it? If that isn't practical, at least I would want to move TEMPDB ( perhaps by using the SP_DETACH and SP_ATTACH method ). My main database is already on D: so I do not have to move it. Any informed advice would be appreciated. Thanks.

View 1 Replies View Related

Integration Services :: Load Data From Flat Files Having Variable Number Of Columns

Jun 23, 2015

I want to load flat files into a single table. But the flat files can have variable number of columns upto a maximum of 10 columns. The table in my database has 10 columns in it. So in case if I load a flat file having 6 columns then rest of the columns in the table will have nulls. I don't want to use script task for this  as I am not good in writing C#code.

View 5 Replies View Related

File System Task - How To Move Directory Contents

Jul 13, 2006



Hi,

I want to move all files of one directory/folder into another usng SSIS, like in DOS Prompt we use the command,

Move d:ftpSource*.* d:ETLSource

I have tried by creating a file system task, but there is no option for Move Directory Contents. Move File is not accepting wild cards.

Regards,

Imran.





View 3 Replies View Related

Looping Through Files

Jan 19, 2008

HI:

I am trying to loop through files in a directory. The tricky part here is that the last part of the filename has seconds, and I never know what that is. I need to use some sort of wildcard I think here. Basically I have a directory with these files:

Export20080112_01_00_08.csv
Export20080113_01_00_06.csv
Export20080114_01_00_03.csv

Once you have got the YYYYMMDD part you have a unique file, so the rest I don't care about. If I could just open the files the way you use a wildcard when you do Windows file searches I could store these in a table:

Export20080112*.csv
Export20080213*.csv
Export20080114*.csv


then use the For Each Container in SSIS for ADO and loop through the filenames. The other option is to use the For Each File but that has to loop through all the files.

Is there a good way to do this using a wildcard?

Thanks,
Kayda

View 3 Replies View Related

Move Sql Database From Development Machine To Server With Active Directory

Dec 23, 2004

Hi all! I know I might sound stupid, but I have this problem. I have developed my database on my laptop which does not use Active directory. Lets say I access the database with: SPIDERMANDB1 on SQL server, where the name of my laptop is SPIDERMAN, and the database is DB1. Now, I create an SQL script from sql server and make the necessary changes, like changing the computer name to say, SUPERMAN where my deployment server's name is SUPERMAN. But when I run the SQL script on the SUPERMAN server, it gives me an error like: "User or role SUPERMANDB1 does not exist in this database". I have deployed databases in this way on servers without Acive directory, so I'm sure its not a mistake on my side. So how am I supposed to go around this active directory thingi! Please help me out! I'm counting on u guys!

Wes

View 4 Replies View Related

Looping Over Files Not Available In My Ssis

May 22, 2006

I'm downloading zip'd files and would like to loop through each file that was downloaded. I'd also like to unizip each file and append all of them to one file. I have a dos batch that is fairly simple and would like to emulate it using ssis. Here is what the dos batch file looks like.



DATE /T >%TEMP%D.txt

FOR /F "usebackq tokens=2,3,4 delims=/, " %%i IN ("%TEMP%D.txt") DO SET fname=TAMF_162%%i%%j%%k-%%k.zip

ECHO xxx>zzzzz
ECHO xxxxx>>zzzzz
ECHO BINARY>>zzzzz
ECHO GET %fname%>>zzzzzz
ECHO QUIT>>zzzzz

FTP -s:zzzzzzz ftp.aaaaa.com

PKUNZIP -o -xxxxxxx downloadedfile_1~1.ZIP

DEL TAMF_1~1.ZIP
DEL zzzzzzzz

EXIT

View 11 Replies View Related

Looping Thru Files By Dates

Mar 31, 2008

how to loop through files by date using a for each loop container
for example if i have files with names
filex_20080405103050
filex_20080405103055
filex_20080405103520
then the file filex_20080405103050 should be picked and loaded first.

View 4 Replies View Related

Integration Services :: File System Task Move Directory Deletes Parent Destination Folder

Mar 12, 2013

I attempted to use Move Directory to move the contents of one directory to another.  I encountered the 'different volume' issue that others have experienced.  While this error is frustrating I can work past this particular issue. My more pressing question is why is the move directory command overwriting a destination directory?  

When I setup the Move directory file task I provided two vars to hold src and dest location:

dest var:  estserveroutput
src var: devserverdev estfiles
Set overwrite destination = TRUE

Why would Move Directory overwrite output folder at destination?  Shouldn't it only overwrite if the testfiles directory exists at destination?  This is very frustrating since I cannot find enough information in the official documentation to understand what is happening here.  

Is it just me or does the documentation for Move directory seem.....incomplete?

View 4 Replies View Related

Move First Record From A Flat File To Another

Jul 18, 2007

Hi,



i have simple requirement...but dont know how to proceed. I need to move the first record from a flat file (file1) to another flat file(file2) using SSIS, file1 will have many records but i just need the first one alone to be moved. Any pointers on this would be of much help.



Thanks,

raj

View 4 Replies View Related

Move Flat File When Error Occurs

Mar 12, 2008

I Have a data flow task inside ForEachLoop.

Inside that dataflow, I was transfering data from a flat file to SQL Server. Now, When error occurs, I want to move that particular file to another location and proceed with the next file. I can't use file system task inside data flow . How can i achieve this ? Is there any other way other than Script-Task (Here script task will be complex thing as of my understanding).

Any solutions ?

View 8 Replies View Related

T-SQL (SS2K8) :: Create Separate MS Excel Files By Looping Through Large Table

Jun 24, 2014

I have a master table containing details of over 800000 surveys made up of approximately 400 distinct document names and versions. Each document can have as few as 10 questions but as many as 150. Each question represents one row.

My challenge is to create a separate spreadsheet for each of the 400 distinct document names and versions containing all the rows and columns present in the master table. The largest number of rows would be around 150 and therefore each spreadsheet will not be very big.

e.g. in my sample data below, i will need to create individual Excel files named as follows . . .
"Document1Version1.xlsx" containing all the column names and 6 rows for the 6 questions relating to Document 1 version 1
"Document1Version2.xlsx" containing all the column names and 8 rows for the 8 questions relating to Document 1 version 2
"Document2Version1.xlsx" containing all the column names and 4 rows for the 4 questions relating to Document 2 version 1

I assume that one of the first things is to create a lookup of the distinct document names and versions assign some variables and then use this lookup to loop through and sequentially filter the master table data ready for creating the individual Excel files.

--CREATE TEMP TABLE FOR EXAMPLE

IF OBJECT_ID('tempdb..#excelTest') IS NOT NULL DROP TABLE #excelTest
CREATE TABLE #excelTest (
[rowID] [nvarchar](10) NULL,
[docName] [nvarchar](50) NULL,

[Code] .....

--Output

rowIDdocNamedocVersionquestionblankField
1document11q1NULL
2document11q2NULL
3document11q3NULL
4document11q4NULL
5document11q5NULL
6document11q6NULL

[Code] .....

View 9 Replies View Related

Get The Specific Files From Directory

Nov 6, 2007

Hi,
      I have some some files names in SQL DATABASE but my actuall files are keep in a seperate folder. so please help me that becasue i dont know that how i can select the specific files from folder and fetch into the imageArray according to the database table. In my coding its get the all files from directory but i want to get from database with where class and then select from directory.
The structure of my table is
create table event_pic(  event_sub_id integer,  event_pic_name varchar(50) )
here is code below:
Sub displayMe()      dim con as new SQLConnection("server=london-home; Database=tony; uid=rashid2; pwd=test; ")    dim cmd as new SQLCommand("select * from event_pic where event_sub_id='5' ",con)       con.open()    dim SDR as SQLDataReader SDR = cmd.ExecuteReader()       con.close()            Dim imageArray() As String        Dim i As Integer                ' grab full path and file of images on server in images folder        imageArray = Directory.GetFiles(Server.MapPath("upload/"), "*.*") 
       ' remove the full path from the image filenames        For i = 0 To (imageArray.Length - 1)            imageArray(i) = Replace(imageArray(i), Server.MapPath("upload/"), "")                    Next                 ViewImages.DataSource = imageArray        ViewImages.DataBind()                    End Sub

View 15 Replies View Related

Deleting Files In A Directory More Than 200

Dec 1, 2003

http://forums.databasejournal.com/showthread.php?s=&threadid=29895

View 2 Replies View Related

Delete Files From Directory?

Nov 15, 2014

how can I delete files, which are allready imported into a database. I have a folder with 600,000 files . All Files should be in a database. And I want to delete the files that are found in the table with filename . How can I make the ?? The Filename and physicals Name is the same so i can say table.filename=physical.filename.

View 20 Replies View Related

Get List Of Files In Directory Using A SP

Jul 23, 2005

Is there an XP/SP out there that will return a list of files residingin a specified directory?I'm looking for something simlar toExecute master..xp_subdirs N'C:'But instead of it returning a list of subdirs I want it to return alist of files in that directory.Jeff

View 5 Replies View Related

How To Delete Old Files Stored In A Directory?

Jan 7, 2003

Hello,
How to delete old files stored in a directory using dos script?.
I appreciate your feedback.
Thanks,
Ravi

View 7 Replies View Related

Deleting Files In A Directory More Than 200MB

Dec 1, 2003

Hi,
I have posted a request regarding deleting the file more than 1 month old that we have discussed in bleow URL.

http://forums.databasejournal.com/showthread.php?s=&threadid=29895

My new request is I have enabled C2 Audit mode and wanted to delete old files that is more than 200MB.
Could you Please give me a query ?.
Thanks,
Ravi

View 2 Replies View Related

Copy Files Into Same Destination Directory

Mar 14, 2008



Hi,

How do I copy files from several subdirectories into the same directory? I have about 80 subdirectories of a parent directory from which I want to copy the files and place the copies into the same, flat destination directory. I tried using the copy file and copy directory file system tasks, but this always seems to recreate the subdirectory structure under the destination directory.

How can I get around this in SSIS?

Thanks in advance,

Bruce.

View 6 Replies View Related

SSIS - Best Way To Copy Files From One Directory To Another

May 8, 2007

In SSIS, I was to:

take files from c:directory1
copy them to cirectory2 with a different name (concatenated date on the end)
delete them from c:directory1

Should I be using the Script Task for this? I am wondering if I should be using the File System Task which copies directories or files, but I don't know if I could rename the files during the copy.



Also, I want the directory names to be in the configuration file. I am not sure how to do this. If I set up a flat file source connection, I need to specify a file name and I just want the directory names. How do I get them in the config file and how to I read them into my script from the config file?



Linda

View 25 Replies View Related

How To Load And UnZip Files From FTP Directory

Mar 5, 2008



HI All,
I have Uzip Files to be loaded From ftp.companyname.com, the zip files get updated everyday thus i have to load the newly added files, the Zip file has got 13 text Files within it, the issue is:
1. how do i load it for the new zip file only, the zip files are shown below, i am trying using FTP Task, but need more info.
2. How do i UnZip it and and take the text files and then load them to sql server 2005, each text file has to be loaded to sql server tables.
3. How do i automate it, i mean every time i run the package (on Job based) it has to look the new file only, see the zip file below to understand what i am saying about.

02/25/2008 09:02PM 2,780,729 CompanyName_2008-02-22.zip
02/27/2008 09:04PM 1,274,557 CompanyName_2008-02-23.zip
02/25/2008 08:57PM 1,383,112 CompanyName_2008-02-24.zip
02/26/2008 04:21PM 3,327,882 CompanyName_2008-02-25.zip
02/27/2008 08:44PM 3,623,334 CompanyName_2008-02-26.zip
02/28/2008 05:27PM 3,570,243 CompanyName_2008-02-27.zip
02/29/2008 04:20PM 3,444,375 CompanyName_2008-02-28.zip
03/01/2008 04:17PM 2,655,782 CompanyName_2008-02-29.zip
03/03/2008 04:09AM 1,179,338 CompanyName_2008-03-01.zip
03/03/2008 05:21PM 1,267,777 CompanyName_2008-03-02.zip
03/04/2008 04:49PM 3,238,121 CompanyName_2008-03-03.zip


As you can see the Zip file names are the blues color, they are added at different time, thus what i need is only the current Zip file (i mean i have to Load only the newly added Zip file (recent one)). Thus the SSIS Task has to go to this FTP server and look the newly added zip file. After that i have Unzip it b/se i have 13 text files there, and then Load them to Sql Server 2005.

Please get help on this, the deadline is near by time, if possible try as soon as possible, I would like to say Thank you for every help you do and try.
Thanks,

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved