SQL Compare & SQL Refactor

Slides:



Advertisements
Similar presentations
András Belokosztolszki Managing change in the database world.
Advertisements

Yukon – What is New Rajesh Gala. Yukon – What is new.NET Framework Programming Data Types Exception Handling Batches Databases Database Engine Administration.
Stored procedures and views You can see definitions for stored procedures and views in the demo databases but you can’t change them. For views, expand.
Chapter 18 - Data sources and datasets 1 Outline How to create a data source How to use a data source How to use Query Builder to build a simple query.
Advantage Data Dictionary. agenda Creating and Managing Data Dictionaries –Tables, Indexes, Fields, and Triggers –Defining Referential Integrity –Defining.
Tables Lesson 6. Skills Matrix Tables Tables store data. Tables are relational –They store data organized as row and columns. –Data can be retrieved.
Building Enterprise Applications Using Visual Studio ®.NET Enterprise Architect.
Migrating to EPiServer CMS 5 Johan Björnfot -
Module 9: Managing Schema Objects. Overview Naming guidelines for identifiers in schema object definitions Storage and structure of schema objects Implementing.
How a little code can help with support.. Chris Barba – Developer at Cimarex Energy Blog:
An Investigation of Oracle and SQL Server with respect to Integrity, and SQL Language standards Presented by: Paul Tarwireyi Supervisor: John Ebden Date:
Database Technical Session By: Prof. Adarsh Patel.
Sofia, Bulgaria | 9-10 October SQL Server 2005 High Availability for developers Vladimir Tchalkov Crossroad Ltd. Vladimir Tchalkov Crossroad Ltd.
An Investigation of Oracle and SQL Server with respect to Integrity, and SQL Language standards Presented by: Paul Tarwireyi Supervisor: John Ebden.
Database Change Management One solution to an often complex problem Kevin Hurwitz Headspring Systems
By: Matt Batalon, MCITP  Another form of temporary storage that can be queried or joined against, much like a table variable, temp.
Database Design and Management CPTG /23/2015Chapter 12 of 38 Functions of a Database Store data Store data School: student records, class schedules,
Partners’ Webinar 01/31/2013 Karol Jarkovsky Solution Architect Upgrading Kentico.
Constraints cis 407 Types of Constraints & Naming Key Constraints Unique Constraints Check Constraints Default Constraints Misc Rules and Defaults Triggers.
Database Fundamental & Design by A.Surasit Samaisut Copyrights : All Rights Reserved.
1 Chapter 20 – Data sources and datasets Outline How to create a data source How to use a data source How to use Query Builder to build a simple query.
Database projects in visual studio 2010 Anthony Brown
Session 1 Module 1: Introduction to Data Integrity
Agenda for Class 2/20/2014 Introduce Microsoft’s SQL Server database management system. Use the lab to discuss how to CREATE, DROP and populate (INSERT)
Level 1-2 Trigger Data Base development Current status and overview Myron Campbell, Alexei Varganov, Stephen Miller University of Michigan August 17, 2000.
 CONACT UC:  Magnific training   
CDT/1 Creating data tables and Referential Integrity Objective –To learn about the data constraints supported by SQL2 –To be able to relate tables together.
SQL Basics Review Reviewing what we’ve learned so far…….
Get testing with tSQLt Practical examples and automation Steve Jones SQLServerCentral Red Gate Software.
In this session, you will learn to: Manage databases Manage tables Objectives.
Database Development with SQL Server Data Tools (SSDT) Björn Eriksen, Architect Evangelist DPE Microsoft
Agenda for Today  DATABASE Definition What is DBMS? Types Of Database Most Popular Primary Database  SQL Definition What is SQL Server? Versions Of SQL.
Mastering Master Data Services Presented By: Jeff Prom BI Data Architect Bridgepoint Education MCTS - Business Intelligence, Admin, Developer.
ORACLE's Approach ORALCE uses a proprietary mechanism for security. They user OLS.... ORACLE Labeling Security. They do data confidentiality They do adjudication.
Data Integrity & Indexes / Session 1/ 1 of 37 Session 1 Module 1: Introduction to Data Integrity Module 2: Introduction to Indexes.
Understanding Core Database Concepts Lesson 1. Objectives.
Getting started with Accurately Storing Data
Architecture Review 10/11/2004
Building Enterprise Applications Using Visual Studio®
With Temporal Tables and More
Visual Basic 2010 How to Program
What Is The SSIS Catalog and Why Do I Care?
Effective T-SQL Solutions
Visual Studio Database Tools (aka SQL Server Data Tools)
Dynamic SQL Writing Efficient Queries on the Fly
UFC #1433 In-Memory tables 2014 vs 2016
Dynamic SQL: Writing Efficient Queries on the Fly
Tutorial 8 Objectives Continue presenting methods to import data into Access, export data from Access, link applications with data stored in Access, and.
MS Access Database Connection
SQL Server Data Tools Gert Drapers
ORACLE SQL Developer & SQLPLUS Statements
Populating a Data Warehouse
Populating a Data Warehouse
MANAGING DATA RESOURCES
SQL OVERVIEW DEFINING A SCHEMA
Populating a Data Warehouse
Visual Studio Database Tools (aka SQL Server Data Tools)
Populating a Data Warehouse
Dynamic SQL: Writing Efficient Queries on the Fly
Using JDeveloper.
Microsoft SQL Server 2014 for Oracle DBAs Module 7
SSDT and Database Project Basics
Contents Preface I Introduction Lesson Objectives I-2
Chapter 7 Using SQL in Applications
Chapter 11 Managing Databases with SQL Server 2000
PYTHON: BUILDING GEOPROCESSING TOOLS
Understanding Core Database Concepts
Windows Forms in Visual Studio 2005: An in-depth look at key features
PNW SQL Users Group August 10th, 2011
Samir Behara, Senior Developer, EBSCO
Presentation transcript:

SQL Compare & SQL Refactor András Belokosztolszki 12/03/2008

András Belokosztolszki Software architect at Red Gate Software Responsible for SQL tools: SQL Compare SQL Log Rescue SQL Refactor … many others Events (User groups, SQL Bits) SQL Server Central Blog: http://www.simple-talk.com/community/blogs/andras/default.aspx Articles: http://www.simple-talk.com/author/andr%c3%a1s-belokosztolszki/

Agenda Two case studies Motivation Features Demo Problems SQL Compare SQL Refactor Motivation Features Demo Problems

SQL Compare Compares and synchronizes the schemata of two SQL Server databases. Flagship product Started as a side-project

Database Development Development on the database Compare development database with production/staging database Synchronize/Deploy This is very similar to application development, but

DEMO How to install (standalone application, single ext stored procedure) First the add/modify/delete More stuff (show how the UI works: - many rows - scroll - filter - sort - time range - group by!!!

Challenges SQL Server 7, 2000, 2005, 2008 system tables differ Object dependencies - ordering Textual objects (with options) Defaults DBO; to read all meta information Table rebuilds (identity) Double table rebuilds (partition schemes) CLR Assemblies and rules for their alters Unnamed constraints Impossible cases (default not null)

Difficulties Complex object dependencies Complex rebuild conditions 25 object types, long dependency chains Complex rebuild conditions Massive databases PeopleSoft: 200,000 stored procedures 6.8M parameters 23,000 tables

DB Development Problems: It is NOT compiled code with public/private qualifiers Dependencies can be broken Where are these? What is using this object? Public API Can I modify this? What is in this object? Who changed this the last time? Problems are detected during production? Garbage (unused, possibly unusable code, possibly maintained) Documentation: Where to store? How to retrieve? Legacy code No versioning No audit Data

Database Development With Problems Development on development databases/files Where is the schema stored during development Explore What is in the database Where is the schema stored in the database Compare Are two objects the same? Processed objects (e.g. defaults and constraints) Generated objects (e.g. symmetric keys) Synchronize/Deploy Problems: Data CLR Assemblies Permissions/users

Where Is the Schemata Stored? In the database itself Modified directly Table columns are added Stored procedures added Some validation by SQL Server Execute procedures Query views Source control integration is hard Garbage Creation scripts All development is on SQL files Can be stored in source control Audit log (who, when, what) Validation is a problem Data? Scripts need to populate data MS Data Dude; SQL Compare 6.0 Where Is the Schemata Stored? SQL Compare 6.0; DataDude; MS push ?

Source Control For Databases Source control works with files, the database schema is not in files Problem: identifying the difference between the files and the database schema itself Problems: keeping the files in sync with the database

Reading Backup Files Large demand Backup format is proprietary Database files do differ (2000, 2005, 2008)

SS2008 Support Many new features and changes POWERSUM private (system function) FILESTREAM -> Table build order COLUMNSETS

Development History (Neil, Me, team) Other projects depending on us SQL Data Compare SQL Dependency Tracker SQL Refactor SQL Data Generator SQL Doc SQL Prompt SQL Packager SQL Toolkit SQL Changeset Continuous integration 1-1 dev/tester Unit testing (over 10000 nightly tests, 4-5 servers, daily reports)

SQL Refactor Productivity tool for SQL Server Lay out SQL Smart Rename Smart column rename for views and tables Smart parameter rename for procedures and functions Split Table, can also create referential integrity tables Uppercase Keywords Summarize Script Expand Wildcards in SELECT statements Qualify Object Names Find Unused Variables and Parameters Encapsulate As New Stored Procedure

DEMO How to install (standalone application, single ext stored procedure) First the add/modify/delete More stuff (show how the UI works: - many rows - scroll - filter - sort - time range - group by!!!

Problems and Challenges Management Studio Extensibility DDL Hell in .Net About 20 refactorings, priorities No other tools like this on the market Some refactorings are complex (Table Split) Lay Out (we support nearly 40 options, but is this enough?)

Table Split Motivation: The table rows are very large The database design is changing, and an entity is separated into two with a 1:N or M:1 Domain restriction needs to be added retrospectively

? Questions Andras.Belokosztolszki@red-gate.com http://www.red-gate.com http://www.simple-talk.com/community/blogs/andras/default.aspx http://www.simple-talk.com/author/andr%c3%a1s-belokosztolszk