Presentation is loading. Please wait.

Presentation is loading. Please wait.

Maximizing SSMS for Developers and DBAs

Similar presentations


Presentation on theme: "Maximizing SSMS for Developers and DBAs"— Presentation transcript:

1 Maximizing SSMS for Developers and DBAs
SQLSaturday 2019 Winnipeg, Canada Maximizing SSMS for Developers and DBAs Nem W. Schlecht nemws1

2 Gold Sponsors First timers??

3 Fargo PASS Chapter Leader UNIX Server SysAdmin ~20yrs DBA
About Me Fargo PASS Chapter Leader UNIX Server SysAdmin ~20yrs DBA MySQL ~12yrs MSSQL ~6 yrs Twitter: @nemws1

4 IT Philosophy Modify your solutions for your needs. Stop modifying yourself! (so much) Don't just fix the problem … Fix it for the next time it occurs as well. There are plenty of consumers. Be a creator.

5 Introduction Sections: Stuff in SSMS that you might not be using Stuff you can add to SSMS that will make it even cooler Look at SQL Operations Studio (S.O.S.) Azure Data Studio Lots of Demos

6 Presenting w/ SSMS (2016 on)
Quick Launch (Search for stuff) Presentation Mode PresentEdit – change font sizes PresentOn – Turn on Presentation mode How do you turn it off? (PresentOff?)

7 Presenting w/ SSMS (2016 on)
Presentation Mode RestoreDefaultFonts – Turn off Presentation mode Doesn't resize everything.  Restarting maybe helps…

8 Script As… Little Used in SSMS Templates Regular Expressions
Column header cut/paste Data Corrections No built-in RegEx in SQL! Why!??! Script As…

9 Templates Ctrl-Alt-T View -> Template Explorer
Use Substitutions (Ctrl-Shift-M) <Label,type,default value>

10 Search/Replace (w/ Regex)
Ctrl-H Select "Regular Expressions"

11 Search/Replace (w/ Regex)
Format pasted columns, safely: Search for: \t Replace with: ]\n\t, [ Cleanup… (remove trailing comma)

12 Search/Replace (w/ Regex)
Quote pasted values 1-per line: Search for: ^ Replace with: ,' $ ' Cleanup… (remove beginning comma or trailing quote – depends on the select)

13 Search/Replace (w/ Regex)
More on Regular Expressions Knowing regular expressions is one of THE BEST skills you can add to your resume! Learn them!

14 Script As…. Great to see what SSMS is actually doing
Great to save to templates, modified for your specific purpose! Need to automate something? Grab all the scripts and combine them.

15 Search for "Remove Dark theme" Comment out the next line Start SSMS
Hidden Dark Theme Quit SSMS Go to: C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio Edit ssms.pkgundef (as Administrator) Search for "Remove Dark theme" Comment out the next line Start SSMS

16 Misc. Source code split view Customize Keyboard Shortcuts
Be careful! Right side/scroll index

17 Add-ins / Add-ons / Plugins [Free/Not Free]
SSMSBoost TSQL Code Smells Finder SQL Complete SqlSmash SQLTreeo SoftTree SQL Assistant SQL Code Guard ApexSQL SQL Enlight For SSMS SQL Search Complete SQL Scripts Manager Refactor SQL Hunting Dog Search Red Gate SQL Test Poor Mans T-SQL Formatter Source Control Red Gate SQL Source Control Spotlight Developer Tabs Studio Supratimas dbForge Workload Addin SSMS Tools Pack SQL Server Diagnostics Unit Test SQL Pretty Printer Data Pump SQL Sentry Plan Explorer VersionSQL Index Manager

18 My Top List SSMS Tools Pack SQL Search dbForge
SQL Complete Poor Mans T-SQL Formatter SQL Code Guard

19 Honorable Mentions SqlSmash SSMSBoost ApexSQL *
Requires re-download/install every XX days ApexSQL * I had some issues (thrashing)

20 SSMS Tools Pack SQL History Generate Insert Statements Debug Sections
New Query Template Global Replacement Text Text Format Custom Scripts Connection Coloring CRUD Generator SQL Snippets Export to Excel Plan Analyzer

21 SSMS Tools Pack – SQL History
Save EVERY query you run Local data store Database store Query Search Session Management Restore Last Session Never worry about closing/restarting SSMS Even queries you don't execute (maybe)

22 SSMS Tools Pack – SQL History
C.Y.A. (Cover Your A**) What was that script you ran last quarter to fix that issue? When did you run the script that screwed up your DB? How many queries did you run last month/year/etc.? For me: Required by developers 5 years - ~500MB Identify potential templates

23 SSMS Tools Pack – Global Replacement Texts

24 SSMS Tools Pack – New Query Template

25 Default Query – still an option
C:\Program Files\Microsoft SQL Server\<VERSION>\Tools\Binn\VSShell\Common7\IDE\SqlWorkbenchProjectItems\Sql\sqlfile.sql

26 SSMS Tools Pack – Connection Coloring
Colored bar based on ServerName (or ServerName::DatabaseName) Top/Bottom/Left/Right and tab But… wait… SSMS already has this? Yes, but it is flawed… (in older versions) And doesn't do per-database coloration Regular Expressions (Yes, again!)

27 SSMS Tools Pack – Snippets
SSF<enter> SELECT * FROM SSC<enter> SELECT COUNT(*) FROM CRTI<enter> CREATE TABLE ( ID INT IDENTITY(1,1), )

28 SQL Search Search tables, columns, stored procedures
Any part of the schema Does not search data!

29 SQL Search

30 Poor Man's TSQL Formatter

31 Column Cut/Paste again
Do the same replace, but without newlines Run SQL formatter

32 dbForge SQL Complete Intellisense… that works Database objects
Procedure parameters Can also do code formatting

33 SQL Code Guard (Doesn't work in recent SSMS)
Standardize your SQL Require Semicolons IF block without BEGIN/END Many, many others Can integrate with TFS Can be run on command line * Does NOT work with SSMS 2017

34 SQL Code Guard

35 Misc. Run as another user… AutoHotKey FreeTDS (Linux/Mac)
Using PowerShell (stored creds) AutoHotKey FreeTDS (Linux/Mac)

36 Azure Data Studio SQL Operations Studio (SOS)
Based on Visual Studio Code Extension management (mostly) Runs on Windows/Mac/Linux New Features being added all the time Agent/Job Management

37 Questions??? Wake up!!

38 Thank You!!

39 About Me Twitter: @nemws1


Download ppt "Maximizing SSMS for Developers and DBAs"

Similar presentations


Ads by Google