Executing Dynamic SQL Using sp_executesql
Learn how to create and execute dynamic SQL in your SQL Server projects!
2019-08-13
Learn how to create and execute dynamic SQL in your SQL Server projects!
2019-08-13
2019-03-29
463 reads
2016-06-30
1,696 reads
An alternative solution to passing parameters to sp_executesql.
2016-01-19 (first published: 2014-04-23)
4,120 reads
By ReviewMyDB
Index maintenance has always meant nightly jobs and a window you have to defend....
I’m sure you’ve all heard the tale of Goldilocks and the Three Bears, but...
By Steve Jones
One of the things I’ve been requesting for a number of years is cost...
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