Normally this error occurs when the column in target table doesn’t have the same column length of the source table. To locate the particular column, try the following
SET ANSI_WARNINGS OFF
[Insert your MERGE Statement here]
SET ANSI_WARNINGS ON
Sharing knowledge does not lessen your store, often it gets you more.
Success doesn't happen overnight and patience is key to living your dream life.
Success is a journey not a destination
Normally this error occurs when the column in target table doesn’t have the same column length of the source table. To locate the particular column, try the following
SET ANSI_WARNINGS OFF
[Insert your MERGE Statement here]
SET ANSI_WARNINGS ON
The issue may be because of the column having length greater than 50. By default all columns from the flat file get assigned the length of 50 and by increasing it the issue can be fixed.
a) Right click on Flat File Source > Show Advanced Editor
b) Expand Flat file Source Output > Output Columns > Select the column (you can see that from the error message) Increase the length to 255
The Variable "variablename" hasn't been assigned a default value. Assign a default value and the error will disappear.
Note: This is not an issue in SSIS 2008 but an issue from SSIS 2012, SSIS 2014 and above.
Couldn't find the package configurations tab in SSIS 2012. This is because Package Configurations in SSIS 2012 is available only for the Package Deployment Model and not for Project Deployment Model.
Make sure to convert the project to Package Deployment Model by right-clicking the project and click on Convert to Package Deployment Model.
Normally you don't want a ETL load to fail because of any data errors. For instance, if you have a file with 1000 rows with 10 rows having some issues, you don't want the load to fail. Instead the package must successfully load the 990 rows and the 10 error rows need to be redirected to a separate table to identify the issue and fix them. If it is a flat file then it is worth while to generate and include a Row Number which will help in identifying the row in the flat file.
The error table will have all columns with data type of varchar(max) across all columns with additional columns like ErrorCode, ErrorColumn and ErrorDescription.
Error rows are handled in the Data Flow through the use of the Error Row Configuration properties. These properties tell the Data Flow Components what to do when a row fails an operation, such as data conversion or truncation.
Redirect Row Event Handler denotes that when a row reaches an error for any column marked as redirected, the entire row is sent out the red error path output which normally connects to the Error table destination. If the red error path output is not used then the row will be ignored out of the Data flow.
public override void Input0_ProcessInputRow(Input0Buffer Row)
{
Row.ErrDesc = ComponentMetaData.GetErrorDescription(Row.ErrorCode);
}
When developing an ETL package the first thing that comes to the mind is whether to build single package doing the end-to-end flow or multiple packages doing the same.
Being an Architect, I have been challenged with this question many times from my development team especially around single package model helps in maintaining less number of packages whereas multiple packages creates an overhead with the number of packages.
One Package = One Unit of Work
It is always best practice to have one package doing only one thing. The following benefits can be achieved doing so.
Also we follow the following design patterns
Always name the tasks and components using the following acronyms at the beginning of the task and component names. Following these naming conventions will facilitate on-going maintenance as well as making any global changes to the packages as package updates can be performed programmatically.
| Task | Prefix |
| For Loop Container | FLC |
| Foreach Loop Container | FELC |
| Sequence Container | SEQC |
| ActiveX Script | AXS |
| Analysis Services Execute DDL | ASE |
| Analysis Services Processing | ASP |
| Bulk Insert | BLK |
| Data Flow | DFT |
| Data Mining Query | DMQ |
| Execute DTS 2000 Package | EDPT |
| Execute Package | EPT |
| Execute Process | EPR |
| Execute SQL | SQL |
| File System | FSYS |
| FTP | FTP |
| Message Queue | MSMQ |
| Script | SCR |
| Send Mail | SMT |
| Transfer Database | TDB |
| Transfer Error Messages | TEM |
| Transfer Jobs | TJT |
| Transfer Logins | TLT |
| Transfer Master Stored Procedures | TSP |
| Transfer SQL Server Objects | TSO |
| Web Service | WST |
| WMI Data Reader | WMID |
| WMI Event Watcher | WMID |
| XML | XML |
| Expression | EXPR |
| Component | Prefix |
| DataReader Source | DR_SRC |
| Excel Source | EX_SRC |
| Flat File Source | FF_SRC |
| OLE DB Source | OLE_SRC |
| Raw File Source | RF_SRC |
| XML Source | XML_SRC |
| Aggregate | AGG |
| Audit | AUD |
| Character Map | CHM |
| Conditional Split | CSPL |
| Copy Column | CPYC |
| Data Conversion | DCNV |
| Data Mining Query | DMQ |
| Derived Column | DER |
| Export Column | EXPC |
| Fuzzy Grouping | FZG |
| Fuzzy Lookup | FZL |
| Import Column | IMPC |
| Lookup Column | LKP |
| Merge | MRG |
| Merge Join | MRGJ |
| Multicast | MLT |
| OLE DB Command | CMD |
| Percentage Sampling | PSMP |
| Pivot | PVT |
| Row Count | CNT |
| Row Sampling | RSMP |
| Script Component | SCR |
| Slowly Changing Dimension | SCD |
| Sort | SRT |
| Term Extraction | TEX |
| Term Lookup | TEL |
| Union All | ALL |
| Unpivot | UPVT |
| Data Mining Model Training | DMMT_DST |
| Data Reader Destination | DR_DST |
| Dimension Processing | DP_DST |
| Excel Destination | EX_DST |
| Flat File Destination | FF_DST |
| OLE DB Destination | OLE_DST |
| Partition Processing | PP_DST |
| Raw File Destination | RF_DST |
| Recordset Destination | RS_DST |
| SQL Server Destination | SS_DST |
| SQL Server Mobile Destination | SSM_DST |
Note: Thanks to Jamie Thomson for the naming conventions.
Problem
Got this error when trying to use ExecuteSQLTask dll programmatically in .NET solution.
Solution
Scenario
Got set of messages to process using a For Loop in SSIS. But when there is an error in one message then the rest of the messages are not processed. Given the child package failed the parent package is also failed. How to continue with the messages even a message has errors?
Solution
Set the MaximumErrorCount property of the For Loop container to 0. FailPackageOnFailure: When set to True, the failure of the task or container results in the failure of the package in which it is defined. FailParentOnFailure: When set to True, the failure of the task or container results in the failure of its container. MaximumErrorCount: Property specifies the maximum number of errors that can occur before the item fails.
Want to do delta loads for your Data Warehouse and having problems in storing Last Load time in an SSIS DateTime Variable?
SSIS DateTime data type truncates the milliseconds from the DateTime. To avoid this set the data type for the variable to store the Last Load time as String. e.g.
SELECT CONVERT(VARCHAR(23), LastModified, 121) LastModified FROM ........
Then you can change it to DateTime before passing it back to the database.
.......WHERE LastModified > CONVERT(DATETIME, @LastModified, 121)
Problem
This issue raises if you try to use TransactionOption Required in SSIS while you have error rows to redirect between an OLE DB Source and an OLE DB Destination.
Solution
Instead try using a 3 Execute SQL tasks in the Control Flow with the first one before the data flow task with SQLStatement BEGIN TRANSACTION.
Put the rest of the 2 Execute SQL tasks in the Control Flow below the Data Flow Task with the precedence Constraint set for one as 'Failure' with the SQLStatement ROLLBACK TRANSACTION and the other one with the precedence Constraint set as 'Success' with the SQLStatement COMMIT TRANSACTION
Note: Also make sure to set the RetainSameConnection property on the appropriate ConnectionManager to True.
SSIS doesn't have a built-in component to support SFTP but the following codeplex component can be used or create a script task and write the SFTP file retrieval.
http://ssissftp.codeplex.com/Note:
IF NOT EXISTS (Query Here)
SELECT ''
ELSE
Query Here