Dallas DBAs

Blog Post

TIL: Get-DbaErrorLog

Ed: SQLDork is a Junior DBA on the team here, learning the DBATools in addition to normal DBA stuff™ Today’s dbatools command is Get-DbaErrorLog, which is very similar to...

2020-05-29

31 reads

Blog Post

TIL: Measure-DbaBackupThroughput

Today’s dbatools command: Measure-DbaBackupThroughput This one’s a smaller command, but that doesn’t mean it’s without use. If you need information on backup speeds (throughput) or early warning of possible...

2020-05-26

26 reads

Blog Post

TIL: Get-DbaAgentJobHistory

Another blog post, another dbatools command. Today’s command: Get-DbaAgentJobHistory Basic command, gets all the job history info and pipes it to gridview, because there’s a LOT of info here....

2020-05-14

57 reads

Blog Post

TIL: Get-DbaLastBackup

(This post comes from one of our Junior DBAs – @SQLDork) I’ve been learning dbatools over the past week or so, you can read the previous blog posts here...

2020-05-06

27 reads

Blog Post

TIL: Restore-DbaDatabase

(This post comes from one of our Junior DBAs – @SQLDork) If you haven’t read it already, i recently wrote a blogpost where i go over Backup-DbaDatabase, you can...

2020-04-29

28 reads

Blog Post

TIL: Backup-DbaDatabase

(This post comes from one of our Junior DBAs – @SQLDork) I’m learning how to use dbatools. Today’s command: Backup-DbaDatabase I’m using the 64-bit PowerShell ISE (running as administrator),...

2021-04-26 (first published: )

540 reads

Blog Post

IRL #7: Test Restores and CheckDB

My Pluralsight course for new SQL Server DBAs Problem: My client asked me for a way to automate test restores and CheckDB either ad hoc or on a schedule,...

2020-04-29 (first published: )

517 reads

Blogs

T-SQL Tuesday #198–Change Detection

By

This month we have a new host, Meagan Longoria, who graciously agreed to help...

Redgate and Rome

By

I’m at the UK Redgate office today, meeting with senior leaders in all areas...

Quick Tip: Check Most DTU Expensive Queries in Azure SQL Database

By

Optimizing Azure SQL Database performance often begins with identifying the most resource-intensive queries. Understanding...

Read the latest Blogs

Forums

Creating a JSON Document IV

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Creating a JSON Document IV

Permissions Removal When Changing Object Schema

By Brandie Tarvin

When the schema of an object is changed, SQL Server wipes out the previous...

Visit the forum

Question of the Day

Creating a JSON Document IV

I have this data in a table called dbo.NFLTeams

TeamID  TeamName       City             YearEstablished
------  --------       ----             ---------------
1       Cowboys        Dallas           1960
2       Eagles         Philadelphia     1933
3       Packers        Green Bay        1919
4       Chiefs         Kansas City      1960
5       49ers          San Francisco    1946
6       Broncos        Denver           1960
7       Seahawks       Seattle          1976
8       Patriots       New England      1960
If I run this code, how many rows are returned?
SELECT 
  YearEstablished,
  json_objectagg(city : TeamName)
FROM dbo.NFLTeams
GROUP BY  YearEstablished;

See possible answers