Skip to content

Instantly share code, notes, and snippets.

@LitKnd
Created February 6, 2019 18:24
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 LitKnd/618a175c1c1835e44863fd1786b10cd8 to your computer and use it in GitHub Desktop.
Save LitKnd/618a175c1c1835e44863fd1786b10cd8 to your computer and use it in GitHub Desktop.
/* Trying to reproduce a reported duplicate naming issue in SQL Change Automation */
CREATE TABLE dbo.duplicate (i INT IDENTITY)
CREATE TYPE duplicate AS TABLE
( i INT );
GO
CREATE PROCEDURE dbo.useduplicate
@duplicate duplicate READONLY
AS
SELECT * FROM @duplicate;
DECLARE @duplicate2 AS duplicate;
INSERT INTO @duplicate2 (i)
SELECT 1;
GO
CREATE TRIGGER tr_duplicate ON dbo.duplicate AFTER INSERT AS
BEGIN
DELETE FROM dbo.duplicate WHERE 1 = 0
END
GO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment