Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 Export DATA to TEXT file

Author  Topic 

inbs
Aged Yak Warrior

860 Posts

Posted - 2009-11-04 : 06:50:24
i export data to Text file with ssis, i use dynamic file name .

i run it today so i see 04112009.txt

the problem is when i run it again i see 04112009.txt04112009.txt
(i multiple the variable name)
why?

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-11-04 : 07:22:48
We cannot see from here...


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

inbs
Aged Yak Warrior

860 Posts

Posted - 2009-11-04 : 07:46:09
1.create a flat file connection manager to my file
2.in expression of the flat file i added the expresion to get
04112009.txt
3.create ole db source to my table and connect it to flat file
destionation

4.before all i create file systme task that delete all file in the
folder

do you need more?

Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-11-04 : 07:59:24
Can you show the expression to get the filename?


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

inbs
Aged Yak Warrior

860 Posts

Posted - 2009-11-04 : 08:04:54
my property is connectionString:

expresion:
@[User::DataLoadDir] + "File_" +
(DT_STR,4,1252)YEAR( DATEADD( "yyyy", 0, getdate() )) +
(DT_STR,4,1252)MONTH( DATEADD( "mm", 0, getdate() )) +
(DT_STR,4,1252)DAY( DATEADD( "dd", 0, getdate() )) + "103045.data"

-------------------------
@[User::DataLoadDir] is my path

in first run i get File_2009114103045.data
but in the second run i get:
File_2009114103045.dataFile_2009114103045.data
Go to Top of Page

inbs
Aged Yak Warrior

860 Posts

Posted - 2009-11-04 : 08:09:34
i know where is my problem bedore i export data, i have foreach loop container,that delete all the files and i put in variable the path.

so i know where is my problem

thanks
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-11-04 : 08:56:35
I have tried to reproduce your problem but no success.
I have build an expression to the "connectionstring" and started that package from Visual Studio 3 times - always the same correct name!


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

inbs
Aged Yak Warrior

860 Posts

Posted - 2009-11-04 : 09:33:46
yes you right i wrong
my mistake.

i try to delete some files from my path, how can i do it?

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-11-06 : 02:44:57
quote:
Originally posted by inbs

yes you right i wrong
my mistake.

i try to delete some files from my path, how can i do it?





EXEC xmpCmdshell 'del "your file path"'

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -