Tag: SELECT

Building a SQL Restore Script When Your Backup Runs

It is handy to have a SQL Restore script ready to go for every backup that you run.  Here is a script that will help with that.  

Tagged with: , , , , , , ,

Determining how much of your data file has been modified

SQL Server 2017 introduces a new column in the sys.dm_db_file_space_usage system table. The column is modified_extent_page_count, which tells how many pages have been modified in your data file since the last full backup. What is really interesting about this is that with

Tagged with: , , , , , , ,

Finding Blocking Queries

One of the common problems with when diagnosing what appears to be a slow scenario where there may be blocking involved is determining what is blocking on SQL Server. Here is a query that I like to use. If there

Tagged with: , , , , ,

Azure PDW What is Active

Lately I have had the opportunity to work with performance tuning of queries running on the Azure Parallel Data Warehouse (Azure PDW). This has been interesting in that everything you thought you knew about SQL Server DMV’s, writing queries and

Tagged with: , , ,

Instant File Initialization (IFI)

One way to improve performance on SQL Server is with IFI or Instant File Initialization. Normally files are zeroed out on a database growth during an AUTOGROW, RESTORE, CREATE DATABASE or ALTER DATABASE. This is done by SQL Server when

Tagged with: , , , , , , ,

TSQL Script to Display Agent Job History

It can be a bit time consuming to work through the the SQL Server Management Studio (SSMS) user interface to check on the agent job history to find specific agent jobs that have been run. To help speed that process up,

Tagged with: , , , , , , ,

CTE to Split a String in a function SplitString

Back in 2012 when I was writing my Common Table Expressions book, I came up with the following CTE in a function to split a string into rows. Original Post: http://stevestedman.com/2012/04/using-a-cte-to-split-a-string-into-rows/ At the time, I thought it was pretty handy

Tagged with: , , , , , , ,

SQL Server – sysmaintplan_logdetail

The check for excessive sysmaintplan_logdetail has be added to the Database Health MonitorQuick Scan Report. If you haven’t had a maintenance plan to clean up maintenance plan history, it can grow excessively over time. I recently worked on a

Tagged with: , , , ,

SSRS Report Usage Queries

This last week I had the opportunity to do some work with SSRS, determining some stats on report usage. I ended up digging up some queries that I wrote a couple years ago against the ReportServer database, and thought they

Tagged with: , , , , , , ,
Top