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
48 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
48 reads
I started to add a daily coping tip to the SQLServerCentral newsletter and to the Community Circle, which is helping me deal with the issues in the world. I’m...
2022-01-17
25 reads
Every Database has a DBO or database owner set. Sometimes the owner is invalid, while most of the time the DBO is perfectly normal. It is easy to ignore...
2022-01-17 (first published: 2022-01-05)
680 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
43 reads
Friends, the MidnightDBAs have a plan for 2022. A capital-P Plan. And it involves writing and teaching a lot. The […]
The post Learn some critical SQL Security with the...
2022-01-17
38 reads
I’ve been working on a project to populate an Operational Data Store using Azure Data Factory (ADF). We have been seeking to tune our pipelines so we can import...
2022-01-17 (first published: 2022-01-06)
197 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
32 reads
This blog troubleshoots SQL Server Error Msg 3132, Level 16, State 1 while backing up SQL Database.
2022-01-17
44 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
478 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
68 reads
By Steve Jones
I type fairly well. Well, I type fast, but I do wear out a...
By way of background, a while back I did video called “My New Favourite...
By ReviewMyDB
Index maintenance has always meant nightly jobs and a window you have to defend....
Comments posted to this topic are about the item SQL Art, Part 4: Happy...
Comments posted to this topic are about the item How We Handled a Vendor...
Comments posted to this topic are about the item Cognitive Coverage
I have this data in the dbo.Commission table in a SQL Server 2022 database.
salesperson commission Brian 12 Brian 16 Andy 7 Andy 14 Andy 21 Steve 20 Steve NULLAll the data is a varchar, and I decide to run this query to get the totals for each salesperson.
SELECT SalesPerson
, AVG(TRY_PARSE(Commission AS int)) AS TotalCommission
FROM commission
GROUP BY SalesPerson
GO
What average commission is calculated for Steve? See possible answers