Different approaches of counting number of rows in a table
Today, I received an email from the developer asking if there is a better way instead of the COUNT (*) Transact-SQL...
2014-03-06
1,452 reads
Today, I received an email from the developer asking if there is a better way instead of the COUNT (*) Transact-SQL...
2014-03-06
1,452 reads
This is part of a series where I set up a virtual lab for testing and misc. work. The other...
2014-03-06
1,073 reads
The weakest link in database security is the same as for most all IT security: people.
Because the weakest link is...
2014-03-06
958 reads
In our last article “Why wait statistics are important and how you can start collecting them now!” we discussed a...
2014-03-06
702 reads
In one of SQL Server Central’s recent daily newsletters, Steve Jones’s editorial was inquiring whether or not anyone has been...
2014-03-06
1,176 reads
OK, so you successfully installed SQL Server and you selected to deploy SQL Server Reporting Services using the default installation...
2014-03-06
17,325 reads
How wait statistics are generated
In our last article “Why wait statistics are important and how you can start collecting them...
2014-03-06
704 reads
Photo from @sqlrus
Tonight I was lucky enough to be able to present to my home SQL Server Users Group in...
2014-03-06
578 reads
Earlier this week, I delivered a presentation called “Query Progress Tracking in SQL Server” to my local user group.
Among other...
2014-03-05
622 reads
The simple query to find the database backup status
The select statment consists of
ServerNamedbnameBackupStartDateBackupFinishDateBackupAgeSizestatusTypeThe query will only run from sql 2005...
2014-03-05
509 reads
By James Serra
Microsoft shared a broad set of Fabric, Power BI, and SQL updates at FabCon...
By Steve Jones
No, I’m not quitting or retiring. Just going on vacation, but I leave tonight...
Comments posted to this topic are about the item Let's Talk Certifications, which is...
Comments posted to this topic are about the item The Hidden Security Risks of...
Comments posted to this topic are about the item The Empty Aggregate
I have this table in a SQL Server 2025 database:
CREATE TABLE [dbo].[CustomerOrder] ( [OrderID] [int] NULL, [CustomerID] [int] NULL, [total] [money] NULL ) ON [PRIMARY] GOWhat is returned from this code? (answers are for the sum and then the count)
SELECT SUM(total) AS sum,
COUNT(total) AS count
FROM dbo.CustomerOrder;
See possible answers