How can you set the value 2007-08-21 02:00 AM in a SSIS variable?
-
Define a datetime variable and assign the above value
-
Define a date and time variables and add them together
-
Define the date time variable and pass it to a script component and add time component
-
You cannot set the above value from SSIS
In SQL Server Integration Services (SSIS), variable data types include DateTime, which can directly accept standard date and time string formats like 2007-08-21 02:00 AM.
SSIS's built-in variable types don't let you type a combined date-and-time literal directly in the variable's default value editor beyond a plain datetime assignment in some cases, so the reliable way to set a precise date-time value like 2007-08-21 02:00 AM is to pass the datetime variable into a Script Component and construct/assign the full value (date plus time) in code. This gives full control over both the date and time parts together.