Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

Adding the Current Date to a SSIS Column Expand / Collapse
Author
Message
Posted Sunday, May 11, 2014 9:49 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, May 12, 2014 3:44 PM
Points: 20, Visits: 65
Hi Everyone.
Can someone please tell me how to add the current date to a SSIS column?

Thanks
Post #1569675
Posted Sunday, May 11, 2014 10:00 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, May 12, 2014 3:44 PM
Points: 20, Visits: 65
Hi Everyone.
Sorry, my question above is not complete. It should be as follows:

How do I add the current date to a SSIS column field header?

Thanks
Post #1569676
Posted Sunday, May 11, 2014 11:40 PM
Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Thursday, September 18, 2014 4:13 AM
Points: 747, Visits: 1,315
When you say column header you mean its name, like to make ColumnName_20140512 something like that ?

Post #1569684
Posted Sunday, May 11, 2014 11:46 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, May 12, 2014 3:44 PM
Points: 20, Visits: 65
Hi there.

Yes the column headers name.
Post #1569686
Posted Monday, May 12, 2014 12:01 AM
Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Thursday, September 18, 2014 4:13 AM
Points: 747, Visits: 1,315
Share your scenario why you actually need this working, and at which point you need this column? need more understanding.
Post #1569687
Posted Monday, May 12, 2014 12:33 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, May 12, 2014 3:44 PM
Points: 20, Visits: 65
Hi. I'm not really sure how to better demonstrate this. Basically, I need my field/column names to be dynamic.

Thanks
Post #1569692
Posted Monday, May 12, 2014 1:53 AM


Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Tuesday, August 12, 2014 11:45 PM
Points: 562, Visits: 887
Not sure about your requirement.However you can always define a variable to store the curent date value and can use it as per your requirement whether in Execute SQL Task or Script Component \ Task.

--rhythmk
------------------------------------------------------------------
To post your question use below link

http://www.sqlservercentral.com/articles/Best+Practices/61537/
Post #1569700
Posted Monday, May 12, 2014 4:27 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 8:23 AM
Points: 12,954, Visits: 10,724
What is the source? What is the destination?



How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1569750
Posted Monday, May 12, 2014 4:32 AM
Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Thursday, September 18, 2014 4:13 AM
Points: 747, Visits: 1,315
ganteng1 (5/12/2014)
Hi. I'm not really sure how to better demonstrate this. Basically, I need my field/column names to be dynamic.

Thanks


I still cannot understand the context of your situation but the thing is if you want to add a column at runtime dataflow will crash like it has never crashed before, as SSIS has strongly-typed metadata which means you cannot change it at runtime.

So either you will need to create the newly package on or update the package at the design time.

if you want to change it on run time then you will need to do this

Developing a Custom Data Flow Component

OR

you can also see this Stairway to Biml

hope it helps
Post #1569751
Posted Monday, May 12, 2014 6:29 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, September 19, 2014 7:07 AM
Points: 156, Visits: 680
It is simple enough to have a column in a SQL statement that represents the current date. You can even simplify the SQL statement to just return the current date with: Select GetDate(). By using getDate(), you can define a data flow column that is always going to be a datetime type and won't blow up when the package is ultimately deployed and run.
Post #1569811
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse