Developing Production Quality SQL Code

Slides:



Advertisements
Similar presentations
ORACLE WebDB 2.2 Montse Collados Polidura SL/CO - April 2000.
Advertisements

TDPS Wireless v Enhancements E1 - Multi load E2 - Driver time scheduler.
Advantage Data Dictionary. agenda Creating and Managing Data Dictionaries –Tables, Indexes, Fields, and Triggers –Defining Referential Integrity –Defining.
System Administration Accounts privileges, users and roles
Stanford University EH&S A Service Oriented Architecture For Rich Internet Applications Sheldon M. Heitz.
1 1. SQL SERVER OVERVIEW zWhat Is SQL Server? zInterfaces To Use SQL Server zSQL Server Services zTypes Of Databases zSQL Server Security.
Database Security and Auditing: Protecting Data Integrity and Accessibility Chapter 4 Profiles, Password Policies, Privileges, and Roles.
Security in SQL Jon Holmes CIS 407 Fall Outline Surface Area Connection Strings Authenticating Permissions Data Storage Injections.
Chapter 9 Overview  Reasons to monitor SQL Server  Performance Monitoring and Tuning  Tools for Monitoring SQL Server  Common Monitoring and Tuning.
Chapter 9: Creating Database Conventions & Standards MCITP Administrator: Microsoft SQL Server 2005 Database Server Infrastructure Design Study Guide (70-443)
Overview What is SQL Server? Creating databases Administration Security Backup.
Object Oriented Databases by Adam Stevenson. Object Databases Became commercially popular in mid 1990’s Became commercially popular in mid 1990’s You.
CSCI 6962: Server-side Design and Programming Course Introduction and Overview.
How a little code can help with support.. Chris Barba – Developer at Cimarex Energy Blog:
Database Design for DNN Developers Sebastian Leupold.
By Lecturer / Aisha Dawood 1.  Administering Users  Create and manage database user accounts.  Create and manage roles.  Grant and revoke privileges.
An Investigation of Oracle and SQL Server with respect to Integrity, and SQL Language standards Presented by: Paul Tarwireyi Supervisor: John Ebden Date:
Databases and security continued CMSC 461 Michael Wilson.
Physical Database Design Chapter 6. Physical Design and implementation 1.Translate global logical data model for target DBMS  1.1Design base relations.
Relational Database Management Systems. A set of programs to manage one or more databases Provides means for: Accessing the data Inserting, updating and.
Attacking Applications: SQL Injection & Buffer Overflows.
Understanding SSIS Control Flows Bret Stateham Training Manager Vortex Learning Solutions blogs.netconnex.com.
Module 9 Designing and Implementing Stored Procedures.
IS 221: DATABASE ADMINISTRATION Lecture 6:Create Users & Manage Users. Information Systems Department 1.
Course materials may not be reproduced in whole or in part without the prior written permission of IBM. 5.1 © Copyright IBM Corporation 2008 DB2 9 Fundamentals.
Searching Business Data with MOSS 2007 Enterprise Search Presenter: Corey Roth Enterprise Consultant Stonebridge Blog:
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.
Database Design and Management CPTG /23/2015Chapter 12 of 38 Functions of a Database Store data Store data School: student records, class schedules,
1 Chapter Overview Performing Configuration Tasks Setting Up Additional Features Performing Maintenance Tasks.
1. When things go wrong: how to find SQL error Sveta Smirnova Principle Technical Support Engineer, Oracle.
Module 3 Designing and Implementing Tables. Module Overview Designing Tables Working with Schemas Creating and Altering Tables.
DBT544. DB2/400 Advanced Features Level Check Considerations Database Constraints File Overrides Object and Record Locks Trigger Programs.
Copyright © 2006 Pilothouse Consulting Inc. All rights reserved. Search Overview Search Features: WSS and Office Search Architecture Content Sources and.
Permissions Lesson 13. Skills Matrix Security Modes Maintaining data integrity involves creating users, controlling their access and limiting their ability.
ADO.NET AND STORED PROCEDURES - Swetha Kulkarni. RDBMS ADO.NET Provider  SqlClient  OracleClient  OleDb  ODBC  SqlServerCE System.Data.SqlClient.
SQL Server 2005 Implementation and Maintenance Chapter 6: Security and SQL Server 2005.
Module 6: Administering Reporting Services. Overview Server Administration Performance and Reliability Monitoring Database Administration Security Administration.
SQL Query Analyzer. Graphical tool that allows you to:  Create queries and other SQL scripts and execute them against SQL Server databases. (Query window)
Singleton Academy, Pune. Course syllabus Singleton Academy Pune – Course Syllabus1.
Secure Data Access with SQL Server 2005 Doug Rees Associate Technologist, CM Group
Advanced Database & Client Server Introduction to MS SQL Server 2000 and Transact SQL -
 CONACT UC:  Magnific training   
Developing Custom ASP.NET Providers For Membership And Role Manager Stefan Schackow PRS404 Program Manager – Web Platform and Tools Microsoft Corporation.
SQL Basics Review Reviewing what we’ve learned so far…….
Advanced Analysis Services Security Chris Webb Crossjoin Consulting Limited.
Planning a Migration.
Web Application Vulnerabilities
SQL Server Security & Intrusion Prevention
Managing, Storing, and Executing DTS Packages
Explore the Integration Services Catalog
Web Application Vulnerabilities, Detection Mechanisms, and Defenses
Outsourcing Database Administration
SQL Server 2000 and Access 2000 limits
DBA and IT Professional for ~9 years. Currently I am a Data Architect
Dynamic SQL: Writing Efficient Queries on the Fly
Cisco Data Virtualization
DevOps Database Administration
Searching Business Data with MOSS 2007 Enterprise Search
DevOps Database Administration
On transactions, and Atomic Operations
Transactions, Locking and Query Optimisation
Dynamic SQL: Writing Efficient Queries on the Fly
DBA for ~4+years, IT Professional for 7.5 years.
– JukeBox – transparency, flexibility, speed and comfort!
Outsourcing Database Administration
(Authentication / Authorization)
February 11-13, 2019 Raleigh, NC.
Server-Side Programming
Generate Data with Google Analytics SQL Saturday /04/2019.
What’s New in Dimension
Presentation transcript:

Developing Production Quality SQL Code Paul Nielsen Founder, Ministry Weaver, inc SQL Server MVP 2004 - SQL Server 2008 Bible

Goals Share ideas for better code Strengthen your defense as SQL Developers in your team Set GoFaster = 1

Culture Fix bugs before you add new features Configure with Meta-data, never customize with code Everyone Tests Stress Test Test more No single head of knowledge – shadow, cross train

Script Everything Script 1: Schema, TVP Types, Sequences, Indexes, Triggers, Basic Data Script 2: Procs, Functions Script 3: Test Data Script 4: Proc Execution Name all constraints

Integrity Normalize the design TVPs for wrapping multiple transactions Every FK defined API doc: Describe the Procs with Extended Properties

Security & Permissions Lock down the tables, app can only execute procs Use schemas for granting rights, Never use dbo. Authenticate every proc - user and session Timeout sessions - job Log the actions Hash + Salt the Password Encrypt in flight and at rest Parameterize the Query Row-based Permissions

Error Handling Standardize your Try/Catch, Standardize error trapping, error logging, error reporting Return errors with Return Codes Avoid SQL errors with @Parameter defaults Be careful with data types returned and nulls

Performance Normalize the design Use de-normalized Helper tables for performance Dynamic SQL for the perfect SQL String - parameterize Log the search durations Use the right data type Index carefully Standardize your paging Chunky not chatty

Many Thanks pauln@ministryweaver.com Linked In