SlideShare a Scribd company logo
Tools and Tips:
From Accidental to Efficient
Data Warehouse Developer
Cathrine Wilhelmsen - SQLSaturday Lisbon 2015
Session description
You have probably heard about the Accidental DBA, but what about the Accidental Data
Warehouse developer? We stumbled into the world of data warehousing, learned dimensional
modeling and work with T-SQL and SSIS daily. We're masters of googling solutions to our
problems and make sure our complex ETL processes run without errors. We deliver data to
business users... but we don't deliver data as fast as we want.
You might not be able to rewrite your entire data warehouse or change your team's processes
over night, but there are many things you can do to increase your own productivity and become
a more efficient data warehouse developer.
In this session I will show you some of what I've learned and discovered that has made me
burst out "Oh wow! Why did I not know this yesterday!?" including query improvements, free
tools and scripts, SSMS features and even a couple of things I used to think were only useful for
those scary DBAs.
Thank you to the main sponsors!
Say thank you to organizers and volunteers!
They spend their FREE time to give you this event
Because they are crazy 
Because they want YOU to learn from the BEST IN
THE WORLD
Paulo Matos:
Pedro Simões:
André Batista:
Paulo Borges:
André Melancia:
Murilo Miranda:
Quilson Antunes:
Important Activities
Sponsor Sessions with Raffles
• 15:10 - Rumos, BI4ALL, Bold Int, CozyRoc, Pythian
WIT (Women in Technology)
• 15:10 at BizSpark Room (Ground Floor)
SQLClinic Challenges
• 17:00 BI (Steph Locke)
Cathrine Wilhelmsen
@cathrinew
cathrinewilhelmsen.net
Data Warehouse Architect
Business Intelligence Developer
you
1-3 years?
T-SQL?
SSIS?
once upon a time...
Tools and Tips: From Accidental to Efficient Data Warehouse Developer (SQLSaturday Portugal)
how I felt...
Tools and Tips: From Accidental to Efficient Data Warehouse Developer (SQLSaturday Portugal)
how I want to be...
Tools and Tips: From Accidental to Efficient Data Warehouse Developer (SQLSaturday Portugal)
what?
SSMS
Queries
Biml for SSIS
Tip #1: Visual Information
Connection Colors
Status Bar and Tab Text
Results in Separate Tab
Tab Groups - Vertical
Tab Groups - Horizontal
Split –one query in two windows
Tip #2: Shortcuts
Query Shortcuts
Oh, by the way...
SELECT SUM(rows)
FROM sys.partitions
WHERE index_id IN (0, 1)
AND object_id =
OBJECT_ID('Sales');
...querying sys.partitions can be better and faster than COUNT(*)
Keyboard Shortcuts
Assign shortcuts
you frequently use
Remove shortcuts
you accidentally click
(no more "ooops")
msdn.microsoft.com/en-us/library/ms174205.aspx
Magic keys!
HOME END
PG UP PG DNCTRL ALT
SHIFT TAB
Show / Hide Query Results
CTRL R
Toggle Full Screen
ALTSHIFT ENTER
Cycle through windows
TABCTRL
Change database while writing query
CTRL U
Column / Multi-Line Editing
SHIFTALT
Comment / Uncomment
CTRL K CTRL C
Comment Line
CTRL K CTRL U
Uncomment Line
Tip #3: Search in SSMS
Free Tool: Redgate SQL Search
red-gate.com/products/sql-development/sql-search/
Free Tool: Redgate SQL Search
Tip #4: Templates and Snippets
Templates
Template Browser
Drag & Drop Templates
Create Templates
CTRL ALT T
Template Parameters
Replace Template Parameters with actual values
CTRL SHIFT M
Snippets
CTRL K CTRL X
Insert Snippet
CTRL K CTRL S
Surround With Snippet
Advanced Snippets and Formatting
Redgate SQL Prompt (Licensed)
ApexSQL Complete / Refactor
SSMS Tools Pack (Licensed)
SSMS Boost
Poor Man's T-SQL Formatter
dbForge SQL Complete (Licensed)
red-gate.com
apexsql.com
ssmstoolspack.com
ssmsboost.com
poorsql.com
devart.com/dbforge
Redgate SQL Prompt Demo
Tip #5: Registered Servers and Multiserver Queries
Registered Servers
Save and group servers
Is the server running?
Multiserver Queries
View Registered Servers
CTRL ALT G
Manage services from SSMS
Multiserver Queries
Multiserver Queries
Tip #6: SARGable Queries
SARGable queries
"The query can efficiently seek using an index to find the
correct rows searched for in WHERE or JOIN clauses"
Compare it to finding a person in a phone book
(We'll pretend we still use phone books)
Adama, Lee
Adama, William
Agathon, Karl
Baltar, Gaius
Dualla, Anastasia
Gaeta, Felix
Henderson, Cally
Roslin, Laura
Thrace, Kara
Tigh, Saul
Tyrol, Galen
Valerii, Sharon
SARGable queries
Find all rows where Name starts with "T"
Adama, Lee
Adama, William
Agathon, Karl
Baltar, Gaius
Dualla, Anastasia
Gaeta, Felix
Henderson, Cally
Roslin, Laura
Thrace, Kara
Tigh, Saul
Tyrol, Galen
Valerii, Sharon
SARGable queries
Find all rows where Name starts with "T"
Non-SARGable queries
"The query has to scan each row in the table to find the
correct rows searched for in WHERE or JOIN clauses"
Compare it to finding a person in a phone book
(We'll keep pretending we still use phone books)
Adama, Lee
Adama, William
Agathon, Karl
Baltar, Gaius
Dualla, Anastasia
Gaeta, Felix
Henderson, Cally
Roslin, Laura
Thrace, Kara
Tigh, Saul
Tyrol, Galen
Valerii, Sharon
Non-SARGable queries
Find all rows where Name contains "al"
Adama, Lee
Adama, William
Agathon, Karl
Baltar, Gaius
Dualla, Anastasia
Gaeta, Felix
Henderson, Cally
Roslin, Laura
Thrace, Kara
Tigh, Saul
Tyrol, Galen
Valerii, Sharon
Non-SARGable queries
Find all rows where Name contains "al"
WHERE Name LIKE '%al%'
WHERE Name LIKE 'T%'
WHERE LEFT(Name,1,1) = 'T'
SARGable or Non-SARGable?
WHERE Name LIKE '%al%'
WHERE Name LIKE 'T%'
WHERE LEFT(Name,1,1) = 'T'
SARGable or Non-SARGable?
WHERE CAST(EpisodeDate AS DATE) = '20050114'
WHERE CONVERT(CHAR(6), EpisodeDate, 112) = '200501'
WHERE YEAR(EpisodeDate) = 2005
WHERE EpisodeDate >= '20050101'
AND EpisodeDate < '20060101'
SARGable or Non-SARGable?
WHERE CAST(EpisodeDate AS DATE) = '20050114'
WHERE CONVERT(CHAR(6), EpisodeDate, 112) = '200501'
WHERE YEAR(EpisodeDate) = 2005
WHERE EpisodeDate >= '20050101'
AND EpisodeDate < '20060101'
SARGable or Non-SARGable?
WHERE Survivors < 40000
WHERE @Survivors BETWEEN Survivors-1000
AND Survivors+1000
WHERE Survivors BETWEEN @Survivors-1000
AND @Survivors+1000
SARGable or Non-SARGable?
WHERE Survivors < 40000
WHERE @Survivors BETWEEN Survivors-1000
AND Survivors+1000
WHERE Survivors BETWEEN @Survivors-1000
AND @Survivors+1000
SARGable or Non-SARGable?
sqlbits.com/Sessions/Event7/Understanding_SARGability_to_make_your_queries_run_faster
Tip #7: Query Analysis
Execution Plans
Display Estimated Execution Plan
CTRL L
Include Actual Execution Plan
CTRL M
Execution Plans
See how a query was or will be executed:
Details in Tooltips (ok)
Details in Properties (better)
Free Tool: SQL Sentry Plan Explorer
sqlsentry.com/products/plan-explorer
Free Tool: SQL Sentry Plan Explorer
answers.sqlperformance.com
Free Book: SQL Server Execution Plans
by Grant Fritchey
red-gate.com/community/books
Tip #8: Query Statistics
Statistics IO
SET STATISTICS IO OFF;
SET STATISTICS IO ON;
Statistics Time
SET STATISTICS TIME OFF;
SET STATISTICS TIME ON;
Free Tool: Statistics Parser by Richie Rump
statisticsparser.com
Client Statistics
Include Client Statistics
SHIFT SALT
Client Statistics
Compare multiple query executions:
Tip #9: Activity Monitoring
Free Script: sp_WhoIsActive by Adam Machanic
sqlblog.com/blogs/adam_machanic
Free Script: sp_WhoIsActive by Adam Machanic
Tip #10: Generate SSIS Packages with Biml
Business Intelligence Markup Language
Easy to read and write XML dialect
Generate SSIS packages from metadata
What do I need?
Free add-in for BIDS / SSDT-BI
bidshelper.codeplex.com
How does it work?
Create many SSIS packages from one Biml file
…what do you need me to do after lunch?
Of course I can create 200 SSIS Packages!
Biml syntax
<Biml xmlns="http://schemas.varigence.com/biml.xsd">
<Connections>
<OleDbConnection Name="Source" ConnectionString="…" />
</Connections>
<Packages>
<Package Name="EmptyPackage">
…
</Package>
</Packages>
</Biml>
From Biml to SSIS
From Biml to SSIS
The magic is in the
Extend Biml with C# or VB.NET code blocks
Import database structure and metadata
Loop over tables and columns
Add expressions to replace static values
BimlScript syntax
<#@ import namespace="Varigence.Hadron.CoreLowerer.SchemaManagement" #>
<# var conAW2014 = SchemaManager.CreateConnectionNode("AW2014", "..."); #>
<# var AW2014DB = conAW2014.ImportDB("","", ImportOptions.ExcludeViews); #>
<Packages>
<# foreach (var table in AW2014DB.TableNodes) { #>
<Package Name="Load_<#=table.Name#>">
…
</Package>
<# } #>
</Packages>
Biml for SSIS demo
…BimlBreak the rest of the week 
Biml on Monday…
Bonus Tip: Be social in your community!
#SQLHelp
cathrinewilhelmsen.net/efficient
Not enough details? Too fast? Don't worry!
Slide deck, links and resources:
Go talk to the sponsors!
Thank you! Enjoy your lunch 
@cathrinew
cathrinewilhelmsen.net
no.linkedin.com/in/cathrinewilhelmsen
contact@cathrinewilhelmsen.net
cathrinewilhelmsen.net/efficient

More Related Content

PDF
Biml for Beginners: Speed up your SSIS development (SQLSaturday Vienna)
PDF
Generate SSIS packages automatically with Biml and BimlScript (SQLKonferenz 2...
PDF
Tools and Tips For Data Warehouse Developers (SQLSaturday Slovenia)
PDF
Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours o...
PDF
Biml for Beginners - Generating SSIS Packages with BimlScript (SQLSaturday Ex...
PDF
Tools and Tips: From Accidental to Efficient Data Warehouse Developer (SQLBit...
PDF
S.M.A.R.T. Biml - Standardize, Model, Automate, Reuse and Transform (SQLSatur...
PDF
Level Up Your Biml: Best Practices and Coding Techniques (NTK 2016)
Biml for Beginners: Speed up your SSIS development (SQLSaturday Vienna)
Generate SSIS packages automatically with Biml and BimlScript (SQLKonferenz 2...
Tools and Tips For Data Warehouse Developers (SQLSaturday Slovenia)
Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours o...
Biml for Beginners - Generating SSIS Packages with BimlScript (SQLSaturday Ex...
Tools and Tips: From Accidental to Efficient Data Warehouse Developer (SQLBit...
S.M.A.R.T. Biml - Standardize, Model, Automate, Reuse and Transform (SQLSatur...
Level Up Your Biml: Best Practices and Coding Techniques (NTK 2016)

What's hot (20)

PDF
Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Sacrame...
PDF
Biml for Beginners: Speed up your SSIS development (SQLSaturday Vancouver)
PDF
Biml for Beginners: Speed up your SSIS development (SQLSaturday Tallinn)
PDF
Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Denver)
PDF
Biml for Beginners: Speed up your SSIS development (SQLSaturday Chicago)
PDF
Biml for Beginners: Speed up your SSIS development (SQLBits XV)
PDF
Don't Repeat Yourself - Agile SSIS Development with Biml and BimlScript (SQL ...
PDF
Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Oslo)
PDF
Biml Academy 2 - Lesson 5: Importing source metadata into Biml
PDF
Tools and Tips: From Accidental to Efficient Data Warehouse Developer (24 Hou...
PDF
Level Up Your Biml: Best Practices and Coding Techniques (TUGA IT 2016)
PDF
Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Minnesota)
PDF
Biml for Beginners - Generating SSIS Packages with BimlScript (SQLSaturday Go...
PDF
Biml for Beginners: Speed up your SSIS development (SQLSaturday Nashville)
PDF
Biml for Beginners: Speed up your SSIS development (Malta Microsoft Data Plat...
PDF
Biml for Beginners: Speed up your SSIS development (SQLSaturday Iceland)
PDF
Biml for Beginners: Speed up your SSIS development (SQL PASS Edmonton )
PDF
Upgrading from SSIS Package Deployment to Project Deployment (SQLSaturday Den...
PDF
Level Up Your Biml: Best Practices and Coding Techniques (SQLBits 2018)
PDF
Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago)
Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Sacrame...
Biml for Beginners: Speed up your SSIS development (SQLSaturday Vancouver)
Biml for Beginners: Speed up your SSIS development (SQLSaturday Tallinn)
Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Denver)
Biml for Beginners: Speed up your SSIS development (SQLSaturday Chicago)
Biml for Beginners: Speed up your SSIS development (SQLBits XV)
Don't Repeat Yourself - Agile SSIS Development with Biml and BimlScript (SQL ...
Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Oslo)
Biml Academy 2 - Lesson 5: Importing source metadata into Biml
Tools and Tips: From Accidental to Efficient Data Warehouse Developer (24 Hou...
Level Up Your Biml: Best Practices and Coding Techniques (TUGA IT 2016)
Level Up Your Biml: Best Practices and Coding Techniques (SQLSaturday Minnesota)
Biml for Beginners - Generating SSIS Packages with BimlScript (SQLSaturday Go...
Biml for Beginners: Speed up your SSIS development (SQLSaturday Nashville)
Biml for Beginners: Speed up your SSIS development (Malta Microsoft Data Plat...
Biml for Beginners: Speed up your SSIS development (SQLSaturday Iceland)
Biml for Beginners: Speed up your SSIS development (SQL PASS Edmonton )
Upgrading from SSIS Package Deployment to Project Deployment (SQLSaturday Den...
Level Up Your Biml: Best Practices and Coding Techniques (SQLBits 2018)
Biml for Beginners: Script and Automate SSIS development (SQLSaturday Chicago)
Ad

Similar to Tools and Tips: From Accidental to Efficient Data Warehouse Developer (SQLSaturday Portugal) (20)

PDF
Tools and Tips: From Accidental to Efficient Data Warehouse Developer (SQLSat...
PDF
Tools and Tips: From Accidental to Efficient Data Warehouse Developer (SQLSat...
PDF
Tools and Tips For Data Warehouse Developers (SQLGLA)
PPTX
SQL PASS BAC - 60 reporting tips in 60 minutes
PPTX
Elegant and Efficient Database Design
PDF
Social media analytics using Azure Technologies
PPT
Get a Little Help with Your Help Desk Application
PPTX
SQL Pass Architecture SQL Tips & Tricks
PDF
From DBA to DE: Becoming a Data Engineer
PPTX
It's Not You. It's Your Data Model.
PPTX
Performance By Design
PPTX
60 reporting tips in 60 minutes - SQLBits 2018
PPTX
Design Patterns for Building 360-degree Views with HBase and Kiji
PPT
Business Intelligence with SQL Server
PPTX
Automating With Excel An Object Oriented Approach
PPTX
SQL Server Tips & Tricks
PDF
7 Dangerous Myths DBAs Believe about Data Modeling
PPTX
Advanced app building with PowerApps expressions and rules
PPT
IBM Insight 2015 - 1824 - Using Bluemix and dashDB for Twitter Analysis
PPTX
Relational Database to Apache Spark (and sometimes back again)
Tools and Tips: From Accidental to Efficient Data Warehouse Developer (SQLSat...
Tools and Tips: From Accidental to Efficient Data Warehouse Developer (SQLSat...
Tools and Tips For Data Warehouse Developers (SQLGLA)
SQL PASS BAC - 60 reporting tips in 60 minutes
Elegant and Efficient Database Design
Social media analytics using Azure Technologies
Get a Little Help with Your Help Desk Application
SQL Pass Architecture SQL Tips & Tricks
From DBA to DE: Becoming a Data Engineer
It's Not You. It's Your Data Model.
Performance By Design
60 reporting tips in 60 minutes - SQLBits 2018
Design Patterns for Building 360-degree Views with HBase and Kiji
Business Intelligence with SQL Server
Automating With Excel An Object Oriented Approach
SQL Server Tips & Tricks
7 Dangerous Myths DBAs Believe about Data Modeling
Advanced app building with PowerApps expressions and rules
IBM Insight 2015 - 1824 - Using Bluemix and dashDB for Twitter Analysis
Relational Database to Apache Spark (and sometimes back again)
Ad

More from Cathrine Wilhelmsen (20)

PDF
Fra utvikler til arkitekt: Skap din egen karrierevei ved å utvikle din person...
PDF
One Year in Fabric: Lessons Learned from Implementing Real-World Projects (PA...
PDF
Data Factory in Microsoft Fabric (MsBIP #82)
PDF
Getting Started: Data Factory in Microsoft Fabric (Microsoft Fabric Community...
PDF
Choosing Between Microsoft Fabric, Azure Synapse Analytics and Azure Data Fac...
PDF
Website Analytics in My Pocket using Microsoft Fabric (SQLBits 2024)
PDF
Data Integration using Data Factory in Microsoft Fabric (ESPC Microsoft Fabri...
PDF
Choosing between Fabric, Synapse and Databricks (Data Left Unattended 2023)
PDF
Data Integration with Data Factory (Microsoft Fabric Day Oslo 2023)
PDF
The Battle of the Data Transformation Tools (PASS Data Community Summit 2023)
PDF
Visually Transform Data in Azure Data Factory or Azure Synapse Analytics (PAS...
PDF
Building an End-to-End Solution in Microsoft Fabric: From Dataverse to Power ...
PDF
Website Analytics in my Pocket using Microsoft Fabric (AdaCon 2023)
PDF
Choosing Between Microsoft Fabric, Azure Synapse Analytics and Azure Data Fac...
PDF
Stressed, Depressed, or Burned Out? The Warning Signs You Shouldn't Ignore (D...
PDF
Stressed, Depressed, or Burned Out? The Warning Signs You Shouldn't Ignore (S...
PDF
"I can't keep up!" - Turning Discomfort into Personal Growth in a Fast-Paced ...
PDF
Lessons Learned: Implementing Azure Synapse Analytics in a Rapidly-Changing S...
PDF
6 Tips for Building Confidence as a Public Speaker (SQLBits 2022)
PDF
Lessons Learned: Understanding Pipeline Pricing in Azure Data Factory and Azu...
Fra utvikler til arkitekt: Skap din egen karrierevei ved å utvikle din person...
One Year in Fabric: Lessons Learned from Implementing Real-World Projects (PA...
Data Factory in Microsoft Fabric (MsBIP #82)
Getting Started: Data Factory in Microsoft Fabric (Microsoft Fabric Community...
Choosing Between Microsoft Fabric, Azure Synapse Analytics and Azure Data Fac...
Website Analytics in My Pocket using Microsoft Fabric (SQLBits 2024)
Data Integration using Data Factory in Microsoft Fabric (ESPC Microsoft Fabri...
Choosing between Fabric, Synapse and Databricks (Data Left Unattended 2023)
Data Integration with Data Factory (Microsoft Fabric Day Oslo 2023)
The Battle of the Data Transformation Tools (PASS Data Community Summit 2023)
Visually Transform Data in Azure Data Factory or Azure Synapse Analytics (PAS...
Building an End-to-End Solution in Microsoft Fabric: From Dataverse to Power ...
Website Analytics in my Pocket using Microsoft Fabric (AdaCon 2023)
Choosing Between Microsoft Fabric, Azure Synapse Analytics and Azure Data Fac...
Stressed, Depressed, or Burned Out? The Warning Signs You Shouldn't Ignore (D...
Stressed, Depressed, or Burned Out? The Warning Signs You Shouldn't Ignore (S...
"I can't keep up!" - Turning Discomfort into Personal Growth in a Fast-Paced ...
Lessons Learned: Implementing Azure Synapse Analytics in a Rapidly-Changing S...
6 Tips for Building Confidence as a Public Speaker (SQLBits 2022)
Lessons Learned: Understanding Pipeline Pricing in Azure Data Factory and Azu...

Recently uploaded (20)

PDF
168300704-gasification-ppt.pdfhghhhsjsjhsuxush
PPTX
05. PRACTICAL GUIDE TO MICROSOFT EXCEL.pptx
PPTX
Global journeys: estimating international migration
PPTX
DISORDERS OF THE LIVER, GALLBLADDER AND PANCREASE (1).pptx
PDF
Recruitment and Placement PPT.pdfbjfibjdfbjfobj
PPTX
Supervised vs unsupervised machine learning algorithms
PPTX
oil_refinery_comprehensive_20250804084928 (1).pptx
PPTX
Database Infoormation System (DBIS).pptx
PPTX
IBA_Chapter_11_Slides_Final_Accessible.pptx
PPTX
Major-Components-ofNKJNNKNKNKNKronment.pptx
PPT
Chapter 2 METAL FORMINGhhhhhhhjjjjmmmmmmmmm
PPTX
STUDY DESIGN details- Lt Col Maksud (21).pptx
PPTX
Introduction to Firewall Analytics - Interfirewall and Transfirewall.pptx
PPTX
ALIMENTARY AND BILIARY CONDITIONS 3-1.pptx
PPTX
Business Acumen Training GuidePresentation.pptx
PPTX
iec ppt-1 pptx icmr ppt on rehabilitation.pptx
PDF
Mega Projects Data Mega Projects Data
PPTX
Computer network topology notes for revision
PPTX
IB Computer Science - Internal Assessment.pptx
168300704-gasification-ppt.pdfhghhhsjsjhsuxush
05. PRACTICAL GUIDE TO MICROSOFT EXCEL.pptx
Global journeys: estimating international migration
DISORDERS OF THE LIVER, GALLBLADDER AND PANCREASE (1).pptx
Recruitment and Placement PPT.pdfbjfibjdfbjfobj
Supervised vs unsupervised machine learning algorithms
oil_refinery_comprehensive_20250804084928 (1).pptx
Database Infoormation System (DBIS).pptx
IBA_Chapter_11_Slides_Final_Accessible.pptx
Major-Components-ofNKJNNKNKNKNKronment.pptx
Chapter 2 METAL FORMINGhhhhhhhjjjjmmmmmmmmm
STUDY DESIGN details- Lt Col Maksud (21).pptx
Introduction to Firewall Analytics - Interfirewall and Transfirewall.pptx
ALIMENTARY AND BILIARY CONDITIONS 3-1.pptx
Business Acumen Training GuidePresentation.pptx
iec ppt-1 pptx icmr ppt on rehabilitation.pptx
Mega Projects Data Mega Projects Data
Computer network topology notes for revision
IB Computer Science - Internal Assessment.pptx

Tools and Tips: From Accidental to Efficient Data Warehouse Developer (SQLSaturday Portugal)