Holy Foreign Keys and Indexes
This article shows an interesting issue with foreign keys and how they are aligned with the base tables in SQL 2005 SP 4.
2011-10-10
5,845 reads
This article shows an interesting issue with foreign keys and how they are aligned with the base tables in SQL 2005 SP 4.
2011-10-10
5,845 reads
Foreign key constraints are an integral part of SQL Server database design. These are used to maintain integrity among related data in different tables. While implementing update and delete operations on values in the parent table (referenced table with primary key) we have to consider the impact on related values in the child table. SQL Server provides different rules for managing the effect of updates and deletes on child table values. How can these rules be used effectively without threatening the relational integrity?
2011-05-03
4,940 reads
Gets all columns infos, foreign keys (multicolumn fk handled), referenced primary keys, default and check constraints, indexes, Create/Drop scripts for all constraints.
2011-02-28 (first published: 2011-02-18)
1,617 reads
Rename the Foreign keys to standard notation - FK_childTable_ParentTable
2010-02-24 (first published: 2010-02-09)
1,204 reads
2010-01-25
3,957 reads
2010-01-07 (first published: 2009-12-18)
1,745 reads
2009-01-23 (first published: 2009-01-14)
2,040 reads
Often during the development phase one is required to truncate a table. often the task of removing foreign key references is necessary to truncate. this sp takes the pain out of it.
2009-01-19 (first published: 2009-01-05)
1,323 reads
2008-10-24
762 reads
2008-09-11
1,541 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