Advanced Error Tracking Get to the root issue immediately!

Slides:



Advertisements
Similar presentations
Cut Costs and Increase Productivity in your IT Organization with Effective Computer and Network Monitoring. Copyright © T3 Software Builders, Inc 2004.
Advertisements

Copyright © SkyeyTech, Inc. BUGtrack Interface.
Week 6: Chapter 6 Agenda Automation of SQL Server tasks using: SQL Server Agent Scheduling Scripting Technologies.
Utility Database Chris
AR Invoices To Customers Presented by Chitra Kanakaraj.
Slide 1 of 9 Presenting 24x7 Scheduler The art of computer automation Press PageDown key or click to advance.
Managing The Risk Solutions and Options Available Utilising Technology By Mohammed Zulfiquar Chief Executive Officer Blue Datum Ltd.
Copyright 2007– WinWare, Inc. Session: How to Utilize the Open Database Architecture of CribMaster Presenter: Phil Stenger.
Today’s Agenda Chapter 12 Admin Tasks Chapter 13 Automating Admin Tasks.
2015 International TechNet Wiki Summit 2015 Saeid Hasani Structured Error Handling Mechanism in SQL Server 2012 & 2014.
Presented By: Product Activation Group Syndication.
Module 12 Handling Errors in T-SQL Code. Module Overview Understanding T-SQL Error Handling Implementing T-SQL Error Handling Implementing Structured.
SAS Workshop Lecture 1 Lecturer: Annie N. Simpson, MSc.
Twin Cities PCC IMb Focus Group May 15, Agenda For Today  Where is my Company in the Full-Service Process?  The Testing Environment for Mailers.
Stored Procedures, Transactions, and Error-Handling
Learningcomputer.com SQL Server 2008 – Administration, Maintenance and Job Automation.
BA372 Stored Procedures and Triggers Lab. What needs to be done to change a customer’s credit limit? Who am I? May I? Do it Log it Display A database.
Module 15 Monitoring SQL Server 2008 R2 with Alerts and Notifications.
Transactions and Locks A Quick Reference and Summary BIT 275.
1 Intro stored procedures Declaring parameters Using in a sproc Intro to transactions Concurrency control & recovery States of transactions Desirable.
SPI NIGHTLIES Alex Hodgkins. SPI nightlies  Build and test various software projects each night  Provide a nightlies summary page that displays all.
SQL Database Management
With Temporal Tables and More
Smarter Technology for Better Business
Lab 6 Instructions You can use g++ on build server, visual studio on local machine or your preferred C++ IDE. Important Note: For your grade, please show.
Cleveland SQL Saturday Catch-All or Sometimes Queries
Dynamic SQL Writing Efficient Queries on the Fly
Data Virtualization Tutorial: Introduction to SQL Script
MAKE YOUR QUERIES FASTER
Exceptions: When things go wrong
Data Interface Module Leighton Wingerd & Manisha Kollu
11 | Error Handling and Transactions
Do You Want To Pass In First Attempt?
DBA and IT Professional for ~9 years. Currently I am a Data Architect
Dynamic SQL: Writing Efficient Queries on the Fly
PROCEDURES, CONDITIONAL LOGIC, EXCEPTION HANDLING, TRIGGERS
mysql and mysql workbench
Basic Work-Flow with SQL Server Standard
Deploying and Configuring SSIS Packages
UK
Microsoft Access Illustrated
Pass Microsoft Exam in First Attempt | Dumps4download.us
DevOps Database Administration
Purpose, Pitfalls and Performance Implications
Bringing DevOps to the Database
Populating a Data Warehouse
DevOps Database Administration
5 WAYS TO BYPASS *OR ENSURE* SQL SERVER SECURITY MATT MARTIN
Advanced PL/SQL Programing
Purpose, Pitfalls and Performance Implications
Visual Studio Database Tools (aka SQL Server Data Tools)
Populating a Data Warehouse
Populating a Data Warehouse
Dynamic SQL: Writing Efficient Queries on the Fly
Bringing DevOps to the Database
Part B – Structured Exception Handling
SQL Server Agent The Life Preserver for the Drowning DBA Lance Tidwell.
Ensuring a Remote Server is Available
DBA for ~4+years, IT Professional for 7.5 years.
MIS2502: Data Analytics MySQL and SQL Workbench
DAT381 Team Development with SQL Server 2005
Outsourcing Database Administration
A Beginners Guide to Transactions
Building a Performance Monitoring System using XEvents and DMVs
Download your FREE 30-day trial at
ITAS Risk Reporting Integration to an ERP
Chapter 11: Exception Handling
Take Your Business to a Higher Altitude with Reporting, Analytics and Budgeting from Jet Global With Channel Manager Aaron Straughan.
Created by Atif Aziz. ELMAH means is "Error Logging Modules and Handlers". It is an application-wide error logging facility that is completely pluggable.
Ch 10. Maintaining and Automating SQL Server
Presentation transcript:

Advanced Error Tracking Get to the root issue immediately! MATT MARTIN SQL Saturday Atlanta | 2016

About 8 years working with SQL Server and SSIS Senior Manager at Fortune 50 Company Responsible for centralizing and building out data warehouse for .COM business Built financial forecasting and budgeting models for really big data sets MD Data Technologies Chief Technology Officer Twitter: @MDDataTech Website: www.sqletl.com Email: matt@sqletl.com

Agenda Common Error Tracking Options Another Creative Solution Identify bottlenecks in procs Where things went wrong Building an error and logging notification system to give you immediate feedback on SQL errors DEMO

Common Error Tracking Options Job Agent msdb.dbo.sysjobhistory table trigger Third Party Software Manual highlighting of lines of code and running one-by-one NOOOOOOOOO!!!!! A well formatted error tracking email with user feedback messages as they occur in the procedure Another Creative Solution

Identify bottlenecks in procs Most developers use a PRINT statement after each line of code. What’s wrong with PRINT? No immediate feedback. Don’t show up to the client until the proc finishes or SQL flushes the buffer

Identify bottlenecks in procs There is a way though to get REAL-TIME feedback! Answer: RAISERROR What? I don’t want to raise errors on my server! RAISERROR can be used to send back real-time messages to the client without having SQL Server throw an actual error by specifying a zero severity. RAISERROR('DATASET ISOLATED TO TEMP TABLE',0,1) WITH NOWAIT

How do we identify the bottleneck? The key is the “NOWAIT” part. This instructs SQL Server to output the message immediately. RAISERROR('DATASET ISOLATED TO TEMP TABLE',0,1) WITH NOWAIT This allows for real-time feedback and the developer does not have to wait until the end of the proc to see output statements.

Where things went wrong Utilizing a wrapper proc that integrates with Database Mail will generate a well formatted and professional email message.

Where things went wrong Place your existing proc in a try/catch CREATE PROC usp_my_proc AS SET NOCOUNT ON; BEGIN TRY EXEC usp_feedback 'attempt to divide by zero' SELECT 1/0 END TRY BEGIN CATCH DECLARE @db_nm varchar(250) = db_name() EXEC usp_etl_err_log @@procid, @db_nm, 'my custom message' END CATCH Just call usp_etl_err_log and the email will go

Now the Fun Stuff! DEMO Building an advanced error notification system