Task Factory Functions List F
FileAppendAllText |
||
---|---|---|
Description | Append text to the end of a file contents. | |
Syntax | FileAppendAllText( Path, Text [, Encoding]) | |
Returns | Boolean. If the path does not exist, null is returned. | |
Parameters | ||
Name | Optional | Description |
Path | false | The path where the file is located. |
Text | false | Text to append to file contents. |
Encoding | true | Encoding to use to write to file. Choices are ASCII, UNICODE, UTF7, UTF8, UTF32 or Default. |
Examples | ||
FileAppendAllText("C:\ssis\test.xml", "Wrox Professional SSIS 2012") |
FileChangeExtension |
||
---|---|---|
Description | Changes the file extension from one to another. | |
Syntax | FileChangeExtension( Path, New_Extension ) | |
Returns | String. The path to the file with the new extension. | |
Parameters | ||
Name | Optional | Description |
Path | false | The path to the file. |
New_Extension | false | The new extension of the file with or without the period. Pass in null to remove the extension. |
Examples | ||
FileChangeExtension("C:\ssis\test.xml", "txt") |
FileCombinePath |
||
---|---|---|
Description | Combines the path of files together. It handles all of the checking for slashes and adds or removes them. | |
Syntax | FileCombinePath( Path1, Path2 ) | |
Returns | String. The combination of path1 and path2 with all slashes added or removed. | |
Parameters | ||
Name | Optional | Description |
Path1 | false | The first part of the path. |
Path2 | false | The second part of the path. |
Examples | ||
FileCombinePath("C:\ssis", "test.xml") |
FileCopy |
||
---|---|---|
Description | Copy a file from one location to another . | |
Syntax | FileCopy( Source, Destination [, Overwrite]) | |
Returns | Boolean. If the copy succeeds. Null of either parameter is null or either the source file doesn't exist. | |
Parameters | ||
Name | Optional | Description |
Source | false | The source path file path. |
Destination | false | The destination file path. |
Overwrite | false | Overwrite the existing file? |
Examples | ||
FileCopy("C:\ssis\test.xml", "C:\ssis\processedfiles\test.xml") |
FileDelete |
||
---|---|---|
Description | Delete a file in the path supplied. | |
Syntax | FileDelete( Path ) | |
Returns | Boolean. True if the file was removed. False if it was not or path parameter is null | |
Parameters | ||
Name | Optional | Description |
Path | false | The path where the file will be removed from. |
Examples | ||
FileDelete("C:\ssis\test") |
FileExists |
||
---|---|---|
Description | Check if the file exists in the path supplied. | |
Syntax | FileExists( Path ) | |
Returns | Boolean. True if the file exists. False if it does not or path parameter is null | |
Parameters | ||
Name | Optional | Description |
Path | false | The path where the file is located. |
Examples | ||
FileExists("C:\ssis\test.xml") |
FileGetCreationTime |
||
---|---|---|
Description | Return the creation time of the file. | |
Syntax | FileGetCreationTime( Path ) | |
Returns | DateTime. If the path does not exist, the minimum date for your system is returned. | |
Parameters | ||
Name | Optional | Description |
Path | false | The path where the file is located. |
Examples | ||
FileGetCreationTime("C:\ssis\test.xml") |
FileGetDirectoryName |
||
---|---|---|
Description | Get the directory of a file path. | |
Syntax | FileGetDirectoryName( Path ) | |
Returns | String | |
Parameters | ||
Name | Optional | Description |
Path | false | The path to the file. |
Examples | ||
FileGetDirectoryName("C:\ssis\test.xml") |
FileGetExtension |
||
---|---|---|
Description | Get the extension of a file. | |
Syntax | FileGetExtension( Path ) | |
Returns | String | |
Parameters | ||
Name | Optional | Description |
Path | false | The path to the file. |
Examples | ||
FileGetExtension("C:\ssis\test.xml") |
FileGetFullPath |
||
---|---|---|
Description | Get the full path to a file. | |
Syntax | FileGetFullPath( Path ) | |
Returns | String | |
Parameters | ||
Name | Optional | Description |
Path | false | The path to the file. |
Examples | ||
FileGetFullPath("C:\ssis\test.xml") |
FileGetLastAccessTime |
||
---|---|---|
Description | Return the time the file was last accessed. | |
Syntax | FileGetLastAccessTime( Path ) | |
Returns | DateTime. If the path does not exist, the minimum date for your system is returned. | |
Parameters | ||
Name | Optional | Description |
Path | false | The path where the file is located. |
Examples | ||
FileGetLastAccessTime("C:\ssis\test.xml") |
FileGetLastWriteTime |
||
---|---|---|
Description | Return the time the file was last written to. | |
Syntax | FileGetLastWriteTime( Path ) | |
Returns | DateTime. If the path does not exist, the minimum date for your system is returned. | |
Parameters | ||
Name | Optional | Description |
Path | false | The path where the file is located. |
Examples | ||
FileGetLastWriteTime("C:\ssis\test.xml") |
FileGetName |
||
---|---|---|
Description | Get the name of file from a file path. | |
Syntax | FileGetName( Path ) | |
Returns | String | |
Parameters | ||
Name | Optional | Description |
Path | false | The path to the file. |
Examples | ||
FileGetName("C:\ssis\test.xml") |
FileGetNameWithoutExtension |
||
---|---|---|
Description | Get the extension of file from a file path. | |
Syntax | FileGetNameWithoutExtension( Path ) | |
Returns | String | |
Parameters | ||
Name | Optional | Description |
Path | false | The path to the file. |
Examples | ||
FileGetNameWithoutExtension("C:\ssis\test.xml") |
FileGetRandomFileName |
||
---|---|---|
Description | Get a random file name without a path | |
Syntax | FileGetRandomFileName( ) | |
Returns | String | |
Examples | ||
FileGetRandomFileName() |
FileGetTempFileName |
||
---|---|---|
Description | Get the name of a temporary file with a path to the temporary directory. | |
Syntax | FileGetTempFileName( ) | |
Returns | String | |
Examples | ||
FileGetTempFileName() |
FileGetTempPath |
||
---|---|---|
Description | Get the path to the temporary files directory. | |
Syntax | FileGetTempPath( ) | |
Returns | String | |
Examples | ||
FileGetTempPath() |
FileHasExtension |
||
---|---|---|
Description | Determine whether a file has an extension. | |
Syntax | FileHasExtension( Path ) | |
Returns | Boolean | |
Parameters | ||
Name | Optional | Description |
Path | false | The path to the file. |
Examples | ||
FileHasExtension("C:\ssis\test"), FileHasExtension("C:\ssis\test.xml") |
FileInUse |
||
---|---|---|
Description | Check if the file is in use for the path supplied. | |
Syntax | FileInUse( Path ) | |
Returns | Boolean. True if the file is in use. False if it is not in use or path parameter is null | |
Parameters | ||
Name | Optional | Description |
Path | false | The path where the file is located. |
Examples | ||
FileInUse("C:\ssis\test.xml") |
FileIsPathRooted |
||
---|---|---|
Description | Gets a value indicating whether the specified path string contains a root. | |
Syntax | FileIsPathRooted( Path ) | |
Returns | Boolean | |
Parameters | ||
Name | Optional | Description |
path | false | The path to the file. |
Examples | ||
FileIsPathRooted("C:\ssis\test"), FileIsPathRooted("test.xml") |
FileMove |
||
---|---|---|
Description | Move a file from one location to another. | |
Syntax | FileMove( Source, Destination) | |
Returns | Boolean. If the move succeeds. Null of either parameter is null or either the source file doesn't exist. | |
Parameters | ||
Name | Optional | Description |
Source | false | The source path file path. |
Destination | false | The destination file path. |
Examples | ||
FileMove("C:\ssis\test.xml", "C:\ssis\processedfiles\test.xml") |
FileOrDirectoryGetPathRoot |
||
---|---|---|
Description | Get the root path to a file. | |
Syntax | FileOrDirectoryGetPathRoot( Path ) | |
Returns | String | |
Parameters | ||
Name | Optional | Description |
Path | false | The path to the file. |
Examples | ||
FileOrDirectoryGetPathRoot("C:\ssis\test.xml"), FileOrDirectoryGetPathRoot("C:\ssis\test\") |
FileReadAllBytes |
||
---|---|---|
Description | Return the bytes from a specified file. | |
Syntax | FileReadAllBytes( Path ) | |
Returns | Byte Array. If the path does not exist, null is returned. | |
Parameters | ||
Name | Optional | Description |
Path | false | The path where the file is located. |
Examples | ||
FileReadAllBytes("C:\ssis\test.xml") |
FileReadAllText |
||
---|---|---|
Description | Return the text from a specified file. | |
Syntax | FileReadAllText( Path ) | |
Returns | String. If the path does not exist, null is returned. | |
Parameters | ||
Name | Optional | Description |
Path | false | The path where the file is located. |
Examples | ||
FileReadAllText("C:\ssis\test.xml") |
FileReplace |
||
---|---|---|
Description | Copy a file from one location to another and create a backup of the destination . | |
Syntax | FileReplace( Source, Destination, Backup_Destination ) | |
Returns | Boolean. If the copy succeeds. Null of either parameter is null or either the source file doesn't exist. | |
Parameters | ||
Name | Optional | Description |
Source | false | The source path file path. |
Destination | false | The destination file path. |
Backup_Destination | false | The path where the backup file will be created. |
Examples | ||
FileReplace("C:\ssis\test.xml", "C:\ssis\processedfiles\test.xml", "C:\ssis\processedfiles\backup\test.xml") |
FileSetCreationTime |
||
---|---|---|
Description | Set the time the file was created. | |
Syntax | FileSetCreationTime( Path, Date_Created ) | |
Returns | Boolean. True if the value is set. False if either parameter is null. | |
Parameters | ||
Name | Optional | Description |
Path | false | The path where the file is located. |
Date_Created | false | The date the file was created. |
Examples | ||
FileSetCreationTime("C:\ssis\test.xml", "7/6/2012 14:24") |
FileSetLastAccessTime |
||
---|---|---|
Description | Set the time the file was last accessed. | |
Syntax | FileSetLastAccessTime( Path, Date_Last_Access ) | |
Returns | Boolean. True if the value is set. False if either parameter is null. | |
Parameters | ||
Name | Optional | Description |
Path | false | The path where the file is located. |
Date_Last_Access | false | The date the file was last accessed. |
Examples | ||
FileSetLastAccessTime("C:\ssis\test.xml", "7/6/2012 14:24") |
FileSetLastWriteTime |
||
---|---|---|
Description | Set the time the file was written to accessed. | |
Syntax | FileSetLastWriteTime( Path, Date_Last_Written ) | |
Returns | Boolean. True if the value is set. False if either parameter is null. | |
Parameters | ||
Name | Optional | Description |
Path | false | The path where the file is located. |
Date_Last_Written | false | The date the file was last written to. |
Examples | ||
FileSetLastWriteTime("C:\ssis\test.xml", "7/6/2012 14:24") |
FileWriteAllBytes |
||
---|---|---|
Description | Write bytes to the file contents. | |
Syntax | FileWriteAllBytes( Path, Bytes [, Encoding]) | |
Returns | Boolean. If the path does not exist, null is returned. | |
Parameters | ||
Name | Optional | Description |
Path | false | The path where the file is located. |
Bytes | false | Bytes to write to the file. |
Encoding | true | Encoding to use to write to file. Choices are ASCII, UNICODE, UTF7, UTF8, UTF32 or Default. |
Examples | ||
FileWriteAllBytes("C:\ssis\test.xml", varBytes, "UTF8") |
FileWriteAllText |
||
---|---|---|
Description | Write text to the file contents. | |
Syntax | FileWriteAllText( Path, Text [, Encoding]) | |
Returns | Boolean. If the path does not exist, null is returned. | |
Parameters | ||
Name | Optional | Description |
Path | false | The path where the file is located. |
Text | false | Text to write to the file. |
Encoding | true | Encoding to use to write to file. Choices are ASCII, UNICODE, UTF7, UTF8, UTF32 or Default. |
Examples | ||
FileWriteAllText("C:\ssis\test.xml", "Wrox Professional SSIS 2012") |
First |
||
---|---|---|
Description | Aggregation that returns the first value of the group. Can only be used as part of the Advanced Aggregation component | |
Syntax | First( Value [, Condition]) | |
Returns | Object. | |
Parameters | ||
Name | Optional | Description |
Value | false | The value to add to the aggregation |
Condition | false | The condition allows you to conditionally add values to the aggregation based on the expression. For instance, you could define the aggregate as First(SalesTotal, CustomerState="FL") and this would only add the value to the aggregation if the customers state was florida. |
Examples | ||
First(SalesTotal), First(SalesTotal, CustomerState="FL") |
FirstDate |
||
---|---|---|
Description | Returns the first day of a specified month. | |
Syntax | FirstDate(), FirstDate( Date ) | |
Returns | returns date | |
Parameters | ||
Name | Optional | Description |
Date | false | Date to retrieve value from |
Examples | ||
FirstDate(), FirstDate("12/8/2011"), FirstDate(varDate), FirstDate(OrderDateColumn) |
FirstDateOfNextMonth |
||
---|---|---|
Description | Returns the first day of a next month. | |
Syntax | FirstDateOfNextMonth(), FirstDateOfNextMonth( Date ) | |
Returns | returns date | |
Parameters | ||
Name | Optional | Description |
Date | false | Date to retrieve value from |
Examples | ||
FirstDateOfNextMonth(), FirstDateOfNextMonth("12/8/2011"), FirstDateOfNextMonth(varDate), FirstDateOfNextMonth(OrderDateColumn) |
Floor |
||
---|---|---|
Description | Returns the largest integer less than or equal to the numeric value you pass to this function. For example, if you pass 3.14 to FLOOR, the function returns 3. If you pass 3.98 to FLOOR, the function returns 3. Likewise, if you pass -3.17 to FLOOR, the function returns -4. | |
Syntax | FLOOR( Numeric_Value ) | |
Returns | Integer if you pass a numeric value with declared precision between 0 and 28. Double if you pass a numeric value with declared precision greater than 28. NULL if a value passed to the function is NULL. | |
Parameters | ||
Name | Optional | Description |
Numeric_Value | false | Numeric datatype. You can enter any valid task editor as long as it evaluates to numeric data. |
Examples | ||
example goes here |
FormatCurrency |
||
---|---|---|
Description | Returns an expression formatted as currency | |
Syntax | FormatCurrency( Expression [, Digits_After_Decimal] [, Include_Leading_Digit] [, Use_Parens_For_Negative_Numbers] [, Group_Digits]) | |
Returns | String. Returns an expression formatted as a currency. | |
Parameters | ||
Name | Optional | Description |
Expression | false | Expression to be formatted. |
Digits_After_Decimal | false | Numeric value indicating how many places are displayed to the right of the decimal. The default value is –1, which indicates that the computer's regional settings are used. |
Include_Leading_Digit | false | Indicates whether a leading 0 is displayed for fractional values. Values are 0 for False, -1 for True |
Use_Parens_For_Negative_Numbers | false | Indicates whether to place negative values within parentheses. Values are 0 for False, -1 for True |
Group_Digits | false | Indicates whether or not numbers are grouped using the group delimiter specified in the locale settings. Values are 0 for False, -1 for True |
Examples | ||
FormatCurrency("4589.932", 2) |
FormatDateTime |
||
---|---|---|
Description | Returns an expression formatted as a date | |
Syntax | FormatDateTime( Expression [, Date_Format] ) | |
Returns | String. Returns an expression formatted as a date. | |
Parameters | ||
Name | Optional | Description |
Expression | false | Date expression to be formatted. |
Date_Format | false | Numeric value that indicates the date/time format used. If omitted, DateFormat.GeneralDate is used. Values are<br /> General Date = 0<br /> Long Date = 1<br /> Short Date = 2 <br /> Long Time = 3<br /> Short Time = 4 |
Examples | ||
FormatDateTime(GetDate(), 2) |
FormatNumber |
||
---|---|---|
Description | Returns an expression formatted as a number | |
Syntax | FormatNumber( Expression [, Digits_After_Decimal] [, Include_Leading_Digit] [, Use_Parens_For_Negative_Numbers] [, Group_Digits]) | |
Returns | String. Returns an expression formatted as a number. | |
Parameters | ||
Name | Optional | Description |
Expression | false | Expression to be formatted. |
Digits_After_Decimal | false | Numeric value indicating how many places are displayed to the right of the decimal. The default value is –1, which indicates that the computer's regional settings are used. |
Include_Leading_Digit | false | Indicates whether a leading 0 is displayed for fractional values. Values are 0 for False, -1 for True |
Use_Parens_For_Negative_Numbers | false | Indicates whether to place negative values within parentheses. Values are 0 for False, -1 for True |
Group_Digits | false | Indicates whether or not numbers are grouped using the group delimiter specified in the locale settings. Values are 0 for False, -1 for True |
Examples | ||
FormatNumber("4589.932", 2) |
FormatPercent |
||
---|---|---|
Description | Returns an expression formatted as a percentage. | |
Syntax | FormatPercent( Expression [, Digits_After_Decimal] [, Include_Leading_Digit] [, Use_Parens_For_Negative_Numbers] [, Group_Digits]) | |
Returns | String. Returns an expression formatted as a percentage. | |
Parameters | ||
Name | Optional | Description |
Expression | false | Expression to be formatted. |
Digits_After_Decimal | false | Numeric value indicating how many places are displayed to the right of the decimal. The default value is –1, which indicates that the computer's regional settings are used. |
Include_Leading_Digit | false | Indicates whether a leading 0 is displayed for fractional values. Values are 0 for False, -1 for True |
Use_Parens_For_Negative_Numbers | false | Indicates whether to place negative values within parentheses. Values are 0 for False, -1 for True |
Group_Digits | false | Indicates whether or not numbers are grouped using the group delimiter specified in the locale settings. Values are 0 for False, -1 for True |
Examples | ||
FormatPercent("4589.932", 2) |
FV |
||
---|---|---|
Description | Returns the future value of an investment, where you make periodic, constant payments and the investment earns a constant interest rate. | |
Syntax | FV( Rate, Terms, Payment [, Present_Value] [, Type] ) | |
Returns | Numeric. | |
Parameters | ||
Name | Optional | Description |
Rate | false | Numeric. Interest rate earned in each period. Expressed as a decimal number. Divide the percent rate by 100 to express it as a decimal number. Must be greater than or equal to 0. |
Terms | false | Numeric. Number of periods or payments. Must be greater than 0. |
Payment | false | Numeric. Payment amount due per period. Must be a negative number. |
Present_Value | true | Numeric. Current value of the investment. If you omit this argument, FV uses 0. |
Type | true | Integer. Timing of the payment. Enter 1 if payment is at the beginning of period. Enter 0 if payment is at the end of period. Default is 0. If you enter a value other than 0 or 1, the Integration Service treats the value as 1. |
Examples | ||
FV(Ratevar, Termvar, Paymentvar), FV(3.25, 36, 125.50, 1200, 1) |