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.
Author |
Topic |
aiman
Starting Member
18 Posts |
Posted - 2007-06-25 : 01:42:42
|
DTS Package Data Export in Text file But problem is File Name should be with Time Stamp. How can i implement it. Please help me.Export File Name should be.WorkCode20070625121010WorkCode20070625121310 WorkCode20070625121610WorkCode20070625121910Package will run schedulely after every 3 minitue.Name format is <WorkCodeYearMonthDayHoureMinuteSecond> |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
ekb18c
Starting Member
18 Posts |
Posted - 2007-06-27 : 21:15:13
|
Well in DTS you need to declare a globalvariable in an activeX script something like:________________________________________________________________________________________'**********************************************************************' Visual Basic ActiveX Script'************************************************************************Function Main() Dim SerialTime SerialDate SerialDate = DatePart("yyyy",date) & Right("00000" & DatePart("m",date),2) & Right("00000" & DatePart("d",date),2) SerialTime = trim(replace(left( time(),8),":","")) DTSGlobalVariables("exportfile1").Value = "C:\workcode" & SerialDate & SerialTime Main = DTSTaskExecResult_SuccessEnd Function___________________________________________________________Then use dynamic properties to set the txt file destination to the global var. |
 |
|
ekb18c
Starting Member
18 Posts |
Posted - 2007-06-27 : 21:28:49
|
oh.. change SerialTime = trim(replace(left( time(),8),":","")) to SerialTime = trim(replace(left( time(),6),":","")) and you should get exactly what you want..Try it out with a msgbox |
 |
|
|
|
|
|
|