Skip to content
Useful SQL Server scripts/SPs for DBA or SQL Developers that I use and/or have created
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
DMV
Dynamic SQL
Extended Events
Functions
Maintenance
Notebooks
PowerBI
PowerShell
Powershell
QueryStore
Schema-Related
Troubleshooting
Views
.gitattributes
.gitignore
LICENSE
README.md

README.md

tsql.tech Code snippets

List of contents:

  • DMV (Estract useful informations from DMVs)

    • Find Active Locks
    • Find Key Lookup in Plan Cache
    • Find Long Running Queries in PlanCache
    • Find Most Expensive Queries in PlanCache
    • Find Plans of your query in PlanCache
    • Find implicit Conversion Queries in PlanCache.
    • Index Usage Statis
    • LatchesStats
    • SpinlockStats
    • Table Sizes
    • Waitstats
  • Dynamic SQL

    • Execute and Track the performance and behavior of Dynamic SQL Statements REFERENCE ARTICLE
  • Extended Events

    • Backup-Restore duration troubleshoot
    • Capture Plans with warning
  • Functions

    • DelimitedSplit8K - The powerful splitting function by Jeff Moden
    • fn_KeepInString - Keep only certain values in a sting See Article
    • fn_RemoveFromString - remove certain patterns from a string See Article
    • fn_TrasposeString - Trasposes strings into tables See Article
  • Maintenance

  • Notebooks

    • Jupyter Notebook to use with SQL Server and Azure Data Studio
  • PowerBI

  • PowerShell

    • Covert Notebook to HTML - Converts a Jupyter Notebook to HTML for easy export [Requires jupyter installed in the System]
    • Create Diagnostic Notebooks - Automatically creates Jupyter Notebooks from the Latest Glen Berry Diagnostic Queries
    • Export to CSV - A sample, simple, export SQL Table to CSV file using SQLServer Powershell Modules
    • PIP upgrade all packages - A simple way to upgrade all the installed Python packages using PIP
  • QueryStore

    • Query Tuning Reccomandations
    • QueryStore_Duration
  • Schema-Related

    • Bulk Move Schema
    • Find Column by name
    • Find Stored Procedure
    • Find primary key candidates
  • Troubleshooting

  • Views

    • BlitzCache_MissingIndexesView - Filters the BlitzCache historic table for misssing indexes reports
    • JobAndSchedules - Shows SQL Agent Jobs and Schedules, by M.Pearson
You can’t perform that action at this time.