error handling in ssis
DESCRIPTION
Error Handling in SSIS. Reza Rad SQL Server MVP, Author, DW / BI Architect. About Me: Reza Rad. SQL Server MVP Author of some SQL Server BI books DW / BI Architect Trainer Author of SSIS Webcast Series. Agenda. Execution Results and Breakpoints in SSDT - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Error Handling in SSIS](https://reader033.vdocument.in/reader033/viewer/2022061610/568161b7550346895dd180ec/html5/thumbnails/1.jpg)
Error Handling in SSIS
Reza RadSQL Server MVP, Author, DW / BI Architect
![Page 2: Error Handling in SSIS](https://reader033.vdocument.in/reader033/viewer/2022061610/568161b7550346895dd180ec/html5/thumbnails/2.jpg)
About Me: Reza RadSQL Server MVPAuthor of some SQL Server BI booksDW / BI ArchitectTrainerAuthor of SSIS Webcast Series
![Page 3: Error Handling in SSIS](https://reader033.vdocument.in/reader033/viewer/2022061610/568161b7550346895dd180ec/html5/thumbnails/3.jpg)
www.NetComLearning.com
Agenda
• Execution Results and Breakpoints in SSDT• Control Flow Failure controlling with Precedence Constraint• Event Handlers• Error Output in Data Flow• Logging for Packages• Logging for Projects in SSIS Catalog• Data Taps
![Page 4: Error Handling in SSIS](https://reader033.vdocument.in/reader033/viewer/2022061610/568161b7550346895dd180ec/html5/thumbnails/4.jpg)
www.NetComLearning.com
Execution Results window in SSDT
• Shows useful information about the package and task that executed• Progress Window• Useful for Debugging• Disable/Enable on Tasks and Containers is helpful for
Debugging• Executing Tasks or Containers
![Page 5: Error Handling in SSIS](https://reader033.vdocument.in/reader033/viewer/2022061610/568161b7550346895dd180ec/html5/thumbnails/5.jpg)
www.NetComLearning.com
Breakpoints in SSDT
• Pause package execution at specific point• You can check value of variables at that point of the time with
three windows;• Autos• Locals• Watch
• The best way of debugging in Control flow in DEV environment
![Page 6: Error Handling in SSIS](https://reader033.vdocument.in/reader033/viewer/2022061610/568161b7550346895dd180ec/html5/thumbnails/6.jpg)
www.NetComLearning.com
Hit Count Types
Always Break always regardless of hit count
Hit count equals Break only if hit count equals counter
Hit count greater than or equal to
Break only if hit count is greater than or equal to counter
Hit count multiple Break only if hit count is an integer multiple of counter
![Page 7: Error Handling in SSIS](https://reader033.vdocument.in/reader033/viewer/2022061610/568161b7550346895dd180ec/html5/thumbnails/7.jpg)
www.NetComLearning.com
DEMO: Debugging in SSDT
• Execution Results/Progress Window• Disable/Enable Tasks and Containers• Breakpoints and Watch window
![Page 8: Error Handling in SSIS](https://reader033.vdocument.in/reader033/viewer/2022061610/568161b7550346895dd180ec/html5/thumbnails/8.jpg)
www.NetComLearning.com
Precedence Constraint in Control Flow
• Three types of precedence constraints• Success• Failure• Completion
• Combination with Expression• AND / OR for multiple tasks
![Page 9: Error Handling in SSIS](https://reader033.vdocument.in/reader033/viewer/2022061610/568161b7550346895dd180ec/html5/thumbnails/9.jpg)
www.NetComLearning.com
Error Configuration in Control Flow
• Maximum Error Count• Gets or sets an Integer value that indicates the maximum number of errors that can occur
before the DtsContainer object stops running.• FailPackageOnFailure• Gets or sets a Boolean that indicates whether the package fails when a child container fails. This
property is used on containers, not the package itself.• true indicates that a failure in the container will set the package execution results to failure.
• FailParentOnFailure• Gets or sets a Boolean that defines whether the parent container fails when a child container
fails.
![Page 10: Error Handling in SSIS](https://reader033.vdocument.in/reader033/viewer/2022061610/568161b7550346895dd180ec/html5/thumbnails/10.jpg)
www.NetComLearning.com
Event Handlers
• Objects Hierarchy• Events Container• List of Events• OnPreExecute• OnPostExecute• OnError• …
![Page 11: Error Handling in SSIS](https://reader033.vdocument.in/reader033/viewer/2022061610/568161b7550346895dd180ec/html5/thumbnails/11.jpg)
www.NetComLearning.com
OnError Event Handler
• ErrorCode, and Error Description System Variables• Useful for logging exact error message
![Page 12: Error Handling in SSIS](https://reader033.vdocument.in/reader033/viewer/2022061610/568161b7550346895dd180ec/html5/thumbnails/12.jpg)
www.NetComLearning.com
DEMO: OnError Event Handler
![Page 13: Error Handling in SSIS](https://reader033.vdocument.in/reader033/viewer/2022061610/568161b7550346895dd180ec/html5/thumbnails/13.jpg)
www.NetComLearning.com
Error Logging in Data Flow
• Most of Data Flow components provides an specific output for ERROR OUTPUT• Error Output contains bad data rows, with additional columns;• ErrorColumn• ErrorCode• ErrorDescription; Can be fetched based on ErrorCode
![Page 14: Error Handling in SSIS](https://reader033.vdocument.in/reader033/viewer/2022061610/568161b7550346895dd180ec/html5/thumbnails/14.jpg)
www.NetComLearning.com
Fetch Error Description
• Error Code is a decimal code, it can be converted to hex, and after 8 F the code will point to an entry of dtsmsg.h file in this path:• C:\Program Files (x86)\Microsoft SQL Server\110\SDK\Include
• Or script component can be used for getting the error message in this way:
Row.ErrorDescription = ComponentMetaData.GetErrorDescription(Row.ErrorCode);
![Page 15: Error Handling in SSIS](https://reader033.vdocument.in/reader033/viewer/2022061610/568161b7550346895dd180ec/html5/thumbnails/15.jpg)
www.NetComLearning.com
DEMO: Error Output in Data Flow
![Page 16: Error Handling in SSIS](https://reader033.vdocument.in/reader033/viewer/2022061610/568161b7550346895dd180ec/html5/thumbnails/16.jpg)
www.NetComLearning.com
Legacy Package Logging
• Design at Development time, configure at runtime• Fie types of logging providers supported
![Page 17: Error Handling in SSIS](https://reader033.vdocument.in/reader033/viewer/2022061610/568161b7550346895dd180ec/html5/thumbnails/17.jpg)
www.NetComLearning.com
SSIS Catalog Logging
• 2012 Introduced SSIS Catalog• SSIS Projects deploy to SSIS Catalog• Logging data will be stored in Catalog• Logging configure and set up at run time• There are four types of logging• Catalog Reports
![Page 18: Error Handling in SSIS](https://reader033.vdocument.in/reader033/viewer/2022061610/568161b7550346895dd180ec/html5/thumbnails/18.jpg)
Catalog Logging Modes
www.NetComLearning.com
![Page 19: Error Handling in SSIS](https://reader033.vdocument.in/reader033/viewer/2022061610/568161b7550346895dd180ec/html5/thumbnails/19.jpg)
www.NetComLearning.com
DEMO: Logging
![Page 20: Error Handling in SSIS](https://reader033.vdocument.in/reader033/viewer/2022061610/568161b7550346895dd180ec/html5/thumbnails/20.jpg)
www.NetComLearning.com
Data Taps
• Stores data at specific point of the time (in a Data Flow’s Data Path) into a text file• Very useful way of logging data rows in production
environment• You can address any data path in the data flow • Output Text file will be stored in • C:\Program Files\Microsoft SQL Server\110\DTS\DataDumps
![Page 21: Error Handling in SSIS](https://reader033.vdocument.in/reader033/viewer/2022061610/568161b7550346895dd180ec/html5/thumbnails/21.jpg)
www.NetComLearning.com
DEMO: Data Tap
![Page 22: Error Handling in SSIS](https://reader033.vdocument.in/reader033/viewer/2022061610/568161b7550346895dd180ec/html5/thumbnails/22.jpg)
www.NetComLearning.com
Summary
• Execution Results and Breakpoints in SSDT• Control Flow Failure controlling with Precedence Constraint• Event Handlers• Error Output in Data Flow• Logging for Production and Live environments• Data Taps for Live environment
![Page 23: Error Handling in SSIS](https://reader033.vdocument.in/reader033/viewer/2022061610/568161b7550346895dd180ec/html5/thumbnails/23.jpg)
www.NetComLearning.com
Summary
• Foreach Loop empowers ETL design• Reduces redundant work• Reduces maintenance and support costs• Improves consistency and standardization
• Empower Foreach Loop with Expressions and Variables
![Page 24: Error Handling in SSIS](https://reader033.vdocument.in/reader033/viewer/2022061610/568161b7550346895dd180ec/html5/thumbnails/24.jpg)
Thank you..Stick Around for Q&A
www.NetComLearning.com