Monday, April 18, 2011

Yesterday's Date Expression with leading zeros

Right( "0" + (DT_WSTR, 2 ) MONTH(Getdate()),2)  +
(DT_WSTR, 8) ((DT_I4)Right( "0" + (DT_WSTR, 2 ) DAY (Getdate()),2)    -1) +
Right((DT_WSTR,4)YEAR(GETDATE()),2)

Tuesday, April 5, 2011

Usefull SSIS tools

Today I'm listing 4 of my useful SSIS third party tools


1-BIDS Helper, The variables extension is an amazing and a must tool for changing the variable's scope  http://bidshelper.codeplex.com/

2-Validate, create and test variable outide BIDS   SSIS Expression Editor & Tester

3-SSIS Component Explorer http://www.sqllion.com/2009/06/ssis-component-explorer/

4-SSIS Log Analyzer http://ssisloganalyzer.codeplex.com/

Hope that helps.

Strip the file name out of the file path

Strip the file's name out of the file path:

Example: [User::strTest] Value = C:\Test\TestTextFile.TXT
Results: TestTextFile.TXT

RIGHT(@[User::strTest],FINDSTRING(REVERSE(@[User::strTest]),"\\",1)-1)



Strip the file's extension out of the file path:

Example: [User::strTest] Value = C:\Test\TestTextFile.TXT
Results: TXT

RIGHT(@[User::strTest],FINDSTRING(REVERSE(@[User::strTest]),".",1)-1)