Exploring Your SQL Server Databases with T-SQL

Slides:



Advertisements
Similar presentations
Yukon – What is New Rajesh Gala. Yukon – What is new.NET Framework Programming Data Types Exception Handling Batches Databases Database Engine Administration.
Advertisements

Brian Alderman | MCT, CEO / Founder of MicroTechPoint Pete Harris | Microsoft Senior Content Publisher.
AGENDA Tools used in SQL Server 2000 Graphical BOL Enterprise Manager Service Manager CLI Query Analyzer OSQL BCP.
SQL Server Management Studio Introduction
Database Software Application
Database Design for DNN Developers Sebastian Leupold.
1 Overview of Databases. 2 Content Databases Example: Access Structure Query language (SQL)
INFO 344 Web Tools And Development CK Wang University of Washington Spring 2014.
DBSQL 14-1 Copyright © Genetic Computer School 2009 Chapter 14 Microsoft SQL Server.
1 SQL Server 2000 Administration Kashef Mughal MSB.
PHP and MySQL CS How Web Site Architectures Work  User’s browser sends HTTP request.  The request may be a form where the action is to call PHP.
FEN  Data Definition: CREATE TABLE, ALTER TABLE  Data Manipulation: INSERT, UPDATE, DELETE  Queries: SELECT SQL: Structured Query Language.
Database Design and Management CPTG /23/2015Chapter 12 of 38 Functions of a Database Store data Store data School: student records, class schedules,
T-SQL: Simple Changes That Go a Long Way DAVE ingeniousSQL.com linkedin.com/in/ingenioussql.
Indexes and Views Unit 7.
PowerBuilder Online Courses - by Prasad Bodepudi Database Painter Primary & Foreign Keys Extended Attributes PowerBuilder System Tables Database Profiles.
IT Faculty Software Engineering Seniors UML for a simple DataBase Management System Prepared by: أنس الأسود بشير الفروان زهير الزعبي ياسر المحمد.
Learningcomputer.com SQL Server 2008 –Views, Functions and Stored Procedures.
Chapter 3: Relational Databases
Introducing Application and Multi-Server Management.
Scott Fallen Sales Engineer, SQL Sentry Blog: scottfallen.blogspot.com.
2 Copyright © 2008, Oracle. All rights reserved. Building the Physical Layer of a Repository.
Database Design: Solving Problems Before they Start! Ed Pollack Database Administrator CommerceHub.
1 SQL SERVER 2005 Express CE-105 SPRING 2007 Engr. Faisal ur Rehman.
Securing SQL Server Processes with Certificates
Chris Index Feng Shui Chris
Hiding Data from Prying eyes: Using SQL Server 2016 Always Encrypted
Visual Studio Database Tools (aka SQL Server Data Tools)
Visual Studio 2010 Database Projects
SQL Server 2000 and Access 2000 limits
T-SQL: Simple Changes That Go a Long Way
T-SQL: Simple Changes That Go a Long Way
Solving the Hard Problems
Efficiently Searching Schema in SQL Server
Parameter Sniffing in SQL Server Stored Procedures
Chapter 4 Relational Databases
Microsoft Dumps Question Answer - Dumps4download
Download Microsoft Exam - Valid Question Answers - Realexamdumps.com
Download Microsoft Exam Dumps - Valid Microsoft Question Answers - Realexamdumps.com
Transactional Replication A Deeper Dive Drew Furgiuele, Senior DBA IGS
SQL Server May Let You Do It, But it Doesn’t Mean You Should
Troubleshooting Service Broker
Marcos Freccia Stop everything! Top T-SQL tricks to a developer
Populating a Data Warehouse
The Ins and Outs of Indexes
Getting To Know Your Indexes
Populating a Data Warehouse
Populating a Data Warehouse
SQL Saturday New York City May 19th, 2018
Populating a Data Warehouse
PHP and MySQL.
Visual Studio Database Tools (aka SQL Server Data Tools)
Populating a Data Warehouse
Populating a Data Warehouse
Securing SQL Server Processes with Certificates
Dynamic SQL: Writing Efficient Queries on the Fly
Transact SQL Performance Tips
Ascending Key Problem in SQL Server Large Tables
PowerShell & PowerBi Reducing DBAs Context Switching
PowerShell & PowerBi Reducing DBAs Context Switching
Stretch Database - Historical data storage in SQL Server 2016
The Ins and Outs of Indexes
Dynamic Sql Not so scary?
Chapter 11 Managing Databases with SQL Server 2000
SQL Server Fundamentals for Beginners
SQL Server Query Design and Optimization Recommendations
Introduction to MySQL NELINET October 28th, 2005.
T-SQL: Simple Changes That Go a Long Way
The Ins and Outs of Indexes
Navigating SSMS Primer for Beginners
Presentation transcript:

Exploring Your SQL Server Databases with T-SQL Scott Swanberg August 1, 2015 Baton Rouge SQL Saturday

Track: SQL DBA Foundations I'm often asked to analyze performance issues on a SQL Server instances with which I'm unfamiliar. It can be a daunting task. Let's face it, most of the time companies do not have good documentation about their databases. Or if they do, it is outdated, or it takes a few days to locate and retrieve it. 2 | 9/22/2018 Scott Swanberg SQL Saturday

Track: SQL DBA Foundations I will share a set of basic scripts that I've developed, over the years, which mine the metadata in the various system functions, stored procedures, tables, catalog views, and dynamic management views, Together, they reveal all the secrets of the databases on the instance, their size, file locations, and their design, including columns, data types, defaults, foreign keys and indexes. You will walk away with about 40 scripts to reverse engineer a database. 3 | 9/22/2018 Scott Swanberg SQL Saturday

Scott Swanberg I’m from Minnesota, you betcha. I started working with SQL Server with the initial release of SQL Server 6.5. I attended PASS Summit in Seattle 2010 & 2011 I’m a Sr. SQL Server DBA and performance tuning consultant, for Ambient Consulting in Minneapolis First time SQL Saturday Speaker  4 | 9/22/2018 Scott Swanberg SQL Saturday

Scott Swanberg And I have a connection to Baton Rouge. 5 | 9/22/2018 5 | 9/22/2018 Scott Swanberg SQL Saturday

My oldest daughter lives in Baton Rouge. 9/22/2018 Scott Swanberg SQL Saturday

Scott Swanberg contact info Scott.Swanberg@AmbientConsulting.com ScottSwanberg@Comcast.net LinkedIn www.linkedin.com/in/scottswanberg Twitter as @WBLSwany 7 | 9/22/2018 Scott Swanberg SQL Saturday

Exploring Your SQL Server in 5 topics Exploring your Server Basic Database Exploration Exploring your Data Model in depth Foreign Keys and Indexes Object Dependencies 8 | 9/22/2018 Scott Swanberg SQL Saturday

1. Exploring your Servers Basic Server Information Linked Servers List All Databases Last Database Backup Active User Connections by Database 9 | 9/22/2018 Scott Swanberg SQL Saturday

1. Exploring your Servers Demo scripts #1 to #7 10 | 9/22/2018 Scott Swanberg SQL Saturday

2. Basic Database Exploration Database File Location Row Counts for all Tables sp_msforeachbd and sp_msforeachtable Heaps Views Synonyms Stored Procedures Functions Triggers Check Constraints Sys.objects 11 | 9/22/2018 Scott Swanberg SQL Saturday

Sys.objects sys.objects.type AF = Aggregate function (CLR) P = SQL Stored Procedure TA = Assembly (CLR) DML trigger C = CHECK constraint PC = Assembly (CLR) stored-procedure TF = SQL table-valued-function D = DEFAULT (constraint or stand-alone) PG = Plan guide TR = SQL DML trigger F = FOREIGN KEY constraint PK = PRIMARY KEY constraint TT = Table type FN = SQL scalar function R = Rule (old-style, stand-alone) U = Table (user-defined) FS = Assembly (CLR) scalar-function RF = Replication-filter-procedure UQ = UNIQUE constraint FT = Assembly (CLR) table-valued function S = System base table V = View IF = SQL inline table-valued function SN = Synonym X = Extended stored procedure IT = Internal table SQ = Service queue  

2. Basic Database Exploration Demo scripts #8 to #22 13 | 9/22/2018 Scott Swanberg SQL Saturday

3. Exploring your Data Model in depth Data types Column Defaults Computed Columns Identity Columns 14 | 9/22/2018 Scott Swanberg SQL Saturday

3. Exploring your Data Model in depth Demo scripts #23 to #26 15 | 9/22/2018 Scott Swanberg SQL Saturday

4. Foreign Keys and Indexes What indexes exist Which indexes are missing Foreign Keys Missing indexes that support Foreign Keys 16 | 9/22/2018 Scott Swanberg SQL Saturday

4. Foreign Keys and Indexes Demo scripts #27 to #30 17 | 9/22/2018 Scott Swanberg SQL Saturday

5. Object Dependencies sp_msdependencies Query the system catalog views Using a Common Table Expression (CTE) 18 | 9/22/2018 Scott Swanberg SQL Saturday

5. Object Dependencies Demo script #31 to #38 19 | 9/22/2018 19 | 9/22/2018 Scott Swanberg SQL Saturday

Where to find my scripts Google/Bing: Scott Swanberg Simple Talk Google/Bing: Exploring Your SQL Server Databases with T-SQL www.simple-talk.com/author/scott-swanberg/ www.simple-talk.com/sql/database-administration/exploring-your-sql-server-databases-with-t-sql/ 20 | 9/22/2018 Scott Swanberg SQL Saturday

Downloads 9/22/2018 Scott Swanberg SQL Saturday

Minnesota SQL Server Connections. Jason Strate - Minnesota SQL Server MVP http://www.jasonstrate.com/ Dan English - Minnesota SQL Server MVP https://denglishbi.wordpress.com/ Tracy McKibben - Minnesota SQL Server Blogger http://realsqlguy.com/ Joe Sack - Minnesota SQL Server MVP http://www.pluralsight.com/author/joe-sack Scott Swanberg - Minnesota SQL Server simple talk author https://www.simple-talk.com/author/scott-swanberg/ https://www.simple-talk.com/sql/database-administration/exploring-your-sql-server-databases-with-t-sql/ 22 | 9/22/2018 Scott Swanberg SQL Saturday