Auto-suggesting foreign keys and data model archaeology
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,495 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,495 reads
2015-10-07
1,383 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,729 reads
2015-03-24
2,197 reads
2014-12-04 (first published: 2014-11-17)
1,419 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,784 reads
2014-04-14
2,258 reads
This procedure let you list [optional] by table:
-Foreign keys
-Primary key
-Indexes
2015-03-27 (first published: 2014-02-06)
4,027 reads
Get all the dependent tables for a master table up to N level(Till the leaf ) you can either find dependency or you can find all the child tables.
2021-04-14 (first published: 2013-09-04)
3,343 reads
By Steve Jones
This value is something that I still hear today: our best work is done...
By gbargsley
Have you ever received the dreaded error from SQL Server that the TempDB log...
By Chris Yates
Artificial intelligence is no longer a distant concept. It is here, embedded in the...
We have a BI-application that connects to input tables on a SQL Server 2022...
At work we've been getting better at writing what's known as GitHub Actions (workflows,...
Comments posted to this topic are about the item The Tightly Linked View
I try to run this code on SQL Server 2022. All the objects exist in the database.
CREATE OR ALTER VIEW OrderShipping AS SELECT cl.CityNameID, cl.CityName, o.OrderID, o.Customer, o.OrderDate, o.CustomerID, o.cityId FROM dbo.CityList AS cl INNER JOIN dbo.[Order] AS o ON o.cityId = cl.CityNameID GO CREATE OR ALTER FUNCTION GetShipCityForOrder ( @OrderID INT ) RETURNS VARCHAR(50) WITH SCHEMABINDING AS BEGIN DECLARE @city VARCHAR(50); SELECT @city = os.CityName FROM dbo.OrderShipping AS os WHERE os.OrderID = @OrderID; RETURN @city; END; goWhat is the result? See possible answers