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)
 Dynamically creating File name with todays date

Author  Topic 

kgadde
Starting Member

5 Posts

Posted - 2008-06-15 : 20:06:20
Hi

My SSIS package automatically creates Excel files everyday.
i want the excel files to get todays date when they are created .
Eg:06152008 for today and 06162008 for tomorrow
please help

madhu.maddula
Starting Member

10 Posts

Posted - 2008-06-16 : 01:16:38
by using variables, u can do this..
u study about variables first....

Regards
Madhu
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-06-16 : 01:43:47
Create a new variable to hold the file name in your package. Give evaluate as expression property as true for variable and use an expression like

"Your string name" + @[System::CreationDate]
and map the file name property of your excel file destination to this variable in expressions tab of task. This is done by double clicking on task and selecting expression tab on left pane . Then ciclk on botton on right and you'll get a pop up window where you can select a property from combo box on left and assign variable on right.
Go to Top of Page

rgombina
Constraint Violating Yak Guru

319 Posts

Posted - 2008-06-16 : 07:36:50
[code]
Imports System
Imports System.Data
Imports System.Math
Imports Microsoft.SqlServer.Dts.Runtime

Public Class ScriptMain

Public Sub Main()
Dim dailyFile As String

dailyFile = "c:\myDailyFile_" + DateTime.Now.ToString("MMddyyyy") + ".txt"
Dts.Variables("filename").Value = dailyFile

Dts.TaskResult = Dts.Results.Success
End Sub

End Class
[/code]
Go to Top of Page
   

- Advertisement -