Trust, or Verify – How FKs Can (or Cannot) Help Performance
Learn how trusted foreign keys (FK) can help or hurt performance.
2018-08-24 (first published: 2016-03-08)
6,935 reads
Learn how trusted foreign keys (FK) can help or hurt performance.
2018-08-24 (first published: 2016-03-08)
6,935 reads
Understand what FK's do and how they use indexes. Then use my script to see if they're using good indexes.
2018-06-29 (first published: 2016-02-10)
6,373 reads
If you can understand the data model then you can understand the intent of the application developers.
2018-07-06 (first published: 2016-01-26)
5,644 reads
2015-10-07
1,417 reads
Foreign Keys are one of the fundamental characteristics of relational databases and enforce the referential integrity. Is it a good idea to index a FK relationship? When can it help?
2016-09-16 (first published: 2015-06-29)
15,851 reads
2015-03-24
2,224 reads
2014-12-04 (first published: 2014-11-17)
1,450 reads
Aaron Bertrand supplies a script which generates two separate sets of commands: one to drop all foreign key constraints, and one to create them again. These scripts are stored in a table so that, if you drop the constraints and then disaster of some kind strikes during the create, you still have everything handy and can troubleshoot if needed.
2014-10-17
8,457 reads
2014-05-20
1,808 reads
2014-04-14
2,285 reads
By Arun Sirpal
“What exactly did it do on my server?” is the first question a DBA...
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