T-SQL script to Backup database SQL Server with TimeStamp
The T-SQL script takes a full backup of all databases(System databases and user databases) in the format of DataaseName-YYYY-MM-DD-HH-MM-...
2022-01-18
43 reads
The T-SQL script takes a full backup of all databases(System databases and user databases) in the format of DataaseName-YYYY-MM-DD-HH-MM-...
2022-01-18
43 reads
This topic describes how to change the availability mode of an availability replica in an Always On availability group in SQL Server by usin
2022-01-17
33 reads
NULLIF is a SQL function that is used to compare two columns. Use NULLIF to compare two columns and return NULL if they are equal to each ot
2022-01-17
22 reads
This blog troubleshoots SQL Server Error Msg 3132, Level 16, State 1 while backing up SQL Database.
2022-01-17
40 reads
When you are experiencing SQL Server Error Msg 3231, Level 16, State 1 while backing up SQL Database, it is important to troubleshoot the er
2022-01-17
473 reads
Is it possible to use COPY_ONLY backup for restoring differential backups? No, if you try to do so, SQL Server raises error Msg 3136, Level
2022-01-17
60 reads
Troubleshoot error - Install-Module: Administrator rights are required to install modules in 'C:Program FilesWindowsPowerShellModules.'
2022-01-13
58 reads
Troubleshoot PowerShell-No match was found for the specified search criteria, module FailoverClusters
2022-01-13
50 reads
SQL Database Error - BACKUP LOG cannot be performed because there is no current database backup
2022-01-12
35 reads
Troubleshoot “Database might contain bulk-logged changes that have not been backed up” in SQL Server
2022-01-12
136 reads
Good documentation gets you started. Good books get you deep. After years of working...
By Vinay Thakur
In previous posts, we looked at the SQL Server engine. for us DBAs, the...
By Arun Sirpal
You have used Claude. But which Claude? The Claude app (claude.ai, the desktop and...
Comments posted to this topic are about the item Creating a JSON Document IV
By VishnuGupthanSQLPowershellDBA
Comments posted to this topic are about the item Restoring Azure Key Vault Keys...
When the schema of an object is changed, SQL Server wipes out the previous...
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 1960If I run this code, how many rows are returned?
SELECT YearEstablished, json_objectagg(city : TeamName) FROM dbo.NFLTeams GROUP BY YearEstablished;See possible answers