Skip to content

Instantly share code, notes, and snippets.

@matt40k
Created September 6, 2018 08:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matt40k/f1793ecc7e20738ebf5c0d7425e2a4ca to your computer and use it in GitHub Desktop.
Save matt40k/f1793ecc7e20738ebf5c0d7425e2a4ca to your computer and use it in GitHub Desktop.
Demo code for the DROP TABLE IF EXISTS "bug"
DROP TABLE IF EXISTS dbo.ObjectFormerlyATable;
CREATE TABLE dbo.ObjectFormerlyATable
(
ID INT IDENTITY(1,1) NOT NULL
CONSTRAINT PK_dbo_ObjectFormerlyATable PRIMARY KEY CLUSTERED (ID ASC)
);
INSERT INTO dbo.ObjectFormerlyATable DEFAULT VALUES;
SELECT ID FROM dbo.ObjectFormerlyATable;
DROP TABLE IF EXISTS dbo.ObjectFormerlyATable;
GO
CREATE OR ALTER VIEW dbo.ObjectFormerlyATable
AS
SELECT
ID=1
;
GO
SELECT ID FROM dbo.ObjectFormerlyATable;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment