Category Archives: TSQL

Azure Data Studio – My SQL snippets freebie #18

I showed how easy it is to create a snippet in a previous blog and said I would share my snippets file. These are the current SQL snippets sqlblocking – List blocked processes order by head blocking processes sqlschema – … Continue reading

Posted in Azure Data Studio, Productivity, Snippets, TSQL, Uncategorized | Leave a comment

Azure Data Studio – Database Status Dashboard (5/31)

One of the things I was finding I was missing was when restoring databases and adding into availability groups. It was quite easy to see in SSMS when databases, were synchronized or syncronizing or had just plain, fell over when … Continue reading

Posted in Azure Data Studio, Dashboards, SQLSaturday, Tips & Tricks, TSQL | Tagged , , , | Leave a comment

Creating test data using TSQL- 4 weeks of CPU stats

To Spoof the creation of SQL creating the CPU stats for the last 4 weeks I used some useful SQL routines, the full code is linked here but the relevant sections are explained in the blog post. These are a … Continue reading

Posted in DataScotland, Tips & Tricks, TSQL | Leave a comment

5 things in 5 minutes presentation- Data & Gravy

It was 2nd year attending the great data event hosted in Leeds (for those who don’t know its near Manchester and not far from Lancashire), last year I did a full hour presentation. This year I wasn’t as organised submitting … Continue reading

Posted in PowerShell, Productivity, SQL Notebooks, Tips & Tricks, TSQL | Tagged , , , , , , , , , , | 2 Comments

Excel formatting SQL results

Sometimes its the little things that get annoying like requesting some information from a DBA or a system admin at a remote site where you can’t run scripts but need someone to do it for you. Quick example you want … Continue reading

Posted in Productivity, TSQL | Leave a comment

Sysadmin Shenanigans & Lying Error messages

One of the databases that is for DBA use was in restricted user mode , this allows only certain users access to the database, basically its sysadmin users , db_owner or db_creater access to the database. I wanted to create … Continue reading

Posted in TSQL | Tagged , , | Leave a comment

Using Output

The OUTPUT command can be a very useful tool to use at times. The following scripts show a couple of ways it can be used. The code from these scripts can be found here on my shared dropbox. First off … Continue reading

Posted in Tips & Tricks, TSQL | Tagged , | Leave a comment