Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Tips & Tricks with SQL Server 
Performance Tuning, SSAS, SSRS, 
SSIS, and More! 
By Ike Ellis, MVP 
@ike_ellis 
www.ikeell...
So you want to be great at SQL 
Server… SQL Server Integration Services 
SQL Server Analysis Services 
Tabular 
MultiDimen...
Tips From the SQL Consultant 
• For the YouTube/Reddit/Chive/Cracked/Meme generation 
• Lots of disjointed tips 
• Popular...
TIP #1: Query Shortcuts 
• SELECT COUNT(*) FROM 
• SELECT TOP 100 * FROM
TIP #2: Don’t forget the splitter 
bar
TIP #3: Low hanging fruit 
• CRTL-R 
– F6 switches between result tabs 
• Copy, Paste a line without selecting 
• COMMENTS...
TIP #4: Block Commenting 
• Easy column selection – bring up the query window 
– CTRL-SHIFT Q 
• Format the columns comma ...
TIP #5: Code Snippets 
• CTRL-K, CTRL-B – Bring up Code Snippet Manager 
• Copy an existing one from a path and put it in ...
Tip #6: SSIS for the Color Blind
Tip #7: Five minutes on report formatting = 10x more 
impressive 
• Spend 10 minutes on design (as opposed to the zero we ...
Tip #8: The right way to find hardware 
problems 
• Merging PerfMon and Tracing 
• Get the Batch and Completed Events Only...
Tip #9: Lifehack: Readable Presentations 
• Take the average age of the 
people in your audience and 
divide by 2: That’s ...
Tip #10: Check for heaps/clustered 
indexes 
SELECT t.[Name] FROM sys.Indexes i 
JOIN sys.Tables t 
ON t.Object_ID = i.Obj...
Tip #11: The proper way to run an SSIS 
package
Tip #12: No reason to use ISNULL  
CONCAT! 
• Messy vs clean code 
• No + symbol needed 
• No ISNULL needed
Tip #13: How to search schema 
• F7 
• SQLSearch 
– Free 
– Download it! 
– http://www.red-gate.com/products/sql-developme...
Tip #14: Windowing Functions are pretty 
cool 
• They are worth learning, and have a neat evolution
Tip #15: SSDT Search for options 
• No more digging around in options 
• Just search for everything
Tip #16: Scripting: You have two 
choices 
• Two Choices 
– Get good at boring repetitive tasks 
– Get good at PowerShell ...
Tip #17: TempDB Configuration 
• Current thought is 4 logical processors to 1 file 
• Just a good beginning, your mileage ...
Tip #18: Prettify! 
21 
http://extras.sqlservercentral.com/prettifier/prettifier.aspx 
RedGate PlugIn for SQL Server Manag...
Tip #19: Execute scripts over multiple 
servers? 
• Super easy!
Tip #20: Life is so easy with a dates 
table 
• Find the sales numbers for the first Monday of every month 
of the year 
•...
Tip #21: Try_Cast 
• Avoiding terrible casting errors
Tip #22: Never reinvent the wheel 
• Take SQL# for example 
• Good Documentation 
• Easy Syntax 
• Cheap (and much of it i...
Tip #23: Save scripts for easy 
access 
• Lots of repetitive scripts with business logic 
• No reason to write the same qu...
Tip #24: Enforce Business Rules in the 
DB 
• Foreign Keys 
• Unique Constraints 
• Check Constraints 
27
Tip #25: Log, Log, Log (and beware of subscriptions) 
select c.Name 
, e.InstanceName 
, e.UserName 
, e.Parameters 
, e.T...
Ike Ellis 
• http://blog.ikeellis.com 
• http://www.ikeellis.com 
• YouTube 
– http://www.youtube.com/user/IkeEllisData 
•...
Upcoming SlideShare
Loading in …5
×

Tips & Tricks SQL in the City Seattle 2014

954 views

Published on

Latest slide desk for SQL Server tips & tricks for SSRS, SSAS, SSIS, performance tuning, and tooling.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Tips & Tricks SQL in the City Seattle 2014

  1. 1. Tips & Tricks with SQL Server Performance Tuning, SSAS, SSRS, SSIS, and More! By Ike Ellis, MVP @ike_ellis www.ikeellis.com Blog.ikeellis.com http://www.linkedin.com/in/ikeellis
  2. 2. So you want to be great at SQL Server… SQL Server Integration Services SQL Server Analysis Services Tabular MultiDimensional SQL Server Reporting Services Excel Data Quality Services Service Broker Performance Tuning Indexing Query Plans Plan Analysis Memory Management SANs Network Clustering Availability Groups PowerShell Master Data Services Architecture Data Mart Design Data Normalization CDC NoSQL/BigData (At least the MS Cloud Offerings) Competitive Knowledge (Oracle, Tablaeu, QlickView, Postgres) ORMs(Entity Framework, Nhibernate, Micros) Installation/Configuration/Upgrading/Service Packing Power BI PowerMap PowerQuery PowerView PowerPivot T-SQL Querying Stored Procedures Functions Windowing Functions Aggregates CLR MDX DAX XMLA BCP SQL Azure Tooling Redgate SSMS SSDT Past Versions Central Management DacPacs/BacPacs Profiler/Extended Events Auditing Security/Encryption Replication SQLCMD
  3. 3. Tips From the SQL Consultant • For the YouTube/Reddit/Chive/Cracked/Meme generation • Lots of disjointed tips • Popular mistakes I see or easy things I think you can take advantage of • Between 3 – 5 minutes each • Let’s see if we can get through all 20
  4. 4. TIP #1: Query Shortcuts • SELECT COUNT(*) FROM • SELECT TOP 100 * FROM
  5. 5. TIP #2: Don’t forget the splitter bar
  6. 6. TIP #3: Low hanging fruit • CRTL-R – F6 switches between result tabs • Copy, Paste a line without selecting • COMMENTS CTRL-K, C, CTRL-K U • BOOKMARKS CTRL-K, K, CTRL-K N • Refresh cache – CTRL-SHIFT R – Unless RedGate then CTRL-SHIFT D
  7. 7. TIP #4: Block Commenting • Easy column selection – bring up the query window – CTRL-SHIFT Q • Format the columns comma first, like you’re supposed to – SQL PROMPT – CTRL-K, CTRL-Y • Alias a table • CTRL-ALT arrow • Add alias
  8. 8. TIP #5: Code Snippets • CTRL-K, CTRL-B – Bring up Code Snippet Manager • Copy an existing one from a path and put it in the My Snippets Path • Edit the XML • CTRL-K, CTRL-X to place the snippet • Great for common queries – WhoIsActive – sp_Blitz – DBCC OPENTRAN
  9. 9. Tip #6: SSIS for the Color Blind
  10. 10. Tip #7: Five minutes on report formatting = 10x more impressive • Spend 10 minutes on design (as opposed to the zero we typically spend) • Choose colors wisely – 99/100 - developers use the default color palette • HTML color picker websites – http://www.lavishbootstrap.com • MorgueFile – http://www.morguefile.com/
  11. 11. Tip #8: The right way to find hardware problems • Merging PerfMon and Tracing • Get the Batch and Completed Events Only • Never trace from the computer you are monitoring • Always trace to a file and then load in a table after. 11 *Thanks, Grant!
  12. 12. Tip #9: Lifehack: Readable Presentations • Take the average age of the people in your audience and divide by 2: That’s your font size • USE THIS SIZE IF YOUR AUDIENCE IS 110
  13. 13. Tip #10: Check for heaps/clustered indexes SELECT t.[Name] FROM sys.Indexes i JOIN sys.Tables t ON t.Object_ID = i.Object_id WHERE i.type_desc = 'HEAP' ORDER BY t.[Name]
  14. 14. Tip #11: The proper way to run an SSIS package
  15. 15. Tip #12: No reason to use ISNULL  CONCAT! • Messy vs clean code • No + symbol needed • No ISNULL needed
  16. 16. Tip #13: How to search schema • F7 • SQLSearch – Free – Download it! – http://www.red-gate.com/products/sql-development/sql-search/ – Did I mention it’s free? • Dependency Tracker – Not Free, but still cool select object_name(object_id), definition as name from sys.all_sql_modules where definition like '%cust%'
  17. 17. Tip #14: Windowing Functions are pretty cool • They are worth learning, and have a neat evolution
  18. 18. Tip #15: SSDT Search for options • No more digging around in options • Just search for everything
  19. 19. Tip #16: Scripting: You have two choices • Two Choices – Get good at boring repetitive tasks – Get good at PowerShell & Scripting • Who adds more value to their company or their customers? • Who gets paid more?
  20. 20. Tip #17: TempDB Configuration • Current thought is 4 logical processors to 1 file • Just a good beginning, your mileage may very • Start there, then go to 2:1 or 1:1 if necessary • Trace Flag 1117 or autogrow off
  21. 21. Tip #18: Prettify! 21 http://extras.sqlservercentral.com/prettifier/prettifier.aspx RedGate PlugIn for SQL Server Management Studio
  22. 22. Tip #19: Execute scripts over multiple servers? • Super easy!
  23. 23. Tip #20: Life is so easy with a dates table • Find the sales numbers for the first Monday of every month of the year • T-SQL with no dates table • T-SQL with dates table
  24. 24. Tip #21: Try_Cast • Avoiding terrible casting errors
  25. 25. Tip #22: Never reinvent the wheel • Take SQL# for example • Good Documentation • Easy Syntax • Cheap (and much of it is free)
  26. 26. Tip #23: Save scripts for easy access • Lots of repetitive scripts with business logic • No reason to write the same queries for the same tables day after day
  27. 27. Tip #24: Enforce Business Rules in the DB • Foreign Keys • Unique Constraints • Check Constraints 27
  28. 28. Tip #25: Log, Log, Log (and beware of subscriptions) select c.Name , e.InstanceName , e.UserName , e.Parameters , e.TimeStart , e.TimeEnd , e.TimeDataRetrieval , e.TimeProcessing , e.TimeRendering from executionlog e join catalog c on e.reportid = c.ItemID Send a Link, or a file on a shared folder that you can audit. Find someway to audit who opened the link or the file in the folder. Try to avoid sending the PDF without a way to audit it.
  29. 29. Ike Ellis • http://blog.ikeellis.com • http://www.ikeellis.com • YouTube – http://www.youtube.com/user/IkeEllisData • SQL Pass Book Readers – http://bookreaders.sqlpass.org/ • San Diego Tech Immersion Group • Twitter: @ike_ellis • 619.922.9801 • Email address is just my first name @ikeellis.com

×