FK_SalesOrderDetail_SalesOrderHeader 存在
SELECT
SOD.* -- 只 select Sales.SalesOrderDetail Table 欄位
FROM Sales.SalesOrderHeader AS SOH
JOIN Sales.SalesOrderDetail AS SOD ON SOH.SalesOrderID = SOD.SalesOrderID
FK_SalesOrderDetail_SalesOrderHeader 不存在
-- 刪除 FK
ALTER TABLE Sales.SalesOrderDetail DROP CONSTRAINT [FK_SalesOrderDetail_SalesOrderHeader]
GO
SELECT
SOD.*
FROM Sales.SalesOrderHeader AS SOH
JOIN Sales.SalesOrderDetail AS SOD ON SOH.SalesOrderID = SOD.SalesOrderID
沒有留言:
張貼留言