Created
November 18, 2019 18:20
-
-
Save LitKnd/53287c958b2668dffea9caf645d01d3a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE tempdb; | |
GO | |
--reset demo | |
DROP TABLE IF EXISTS dbo.child, | |
dbo.parent; | |
GO | |
CREATE TABLE dbo.parent | |
( | |
i INT IDENTITY, | |
CONSTRAINT pk_parent PRIMARY KEY (i) | |
); | |
GO | |
CREATE TABLE dbo.child | |
( | |
i INT NULL, | |
constraint fk_child_parent FOREIGN KEY (i) REFERENCES dbo.parent(i) | |
); | |
GO | |
DROP TABLE dbo.parent; | |
GO | |
ALTER TABLE dbo.child NOCHECK CONSTRAINT fk_child_parent |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment