Skip to content

Instantly share code, notes, and snippets.

@shaneis
Last active March 28, 2018 13:17
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 shaneis/0509ba3dba46d1887baacc81c8c0b7a5 to your computer and use it in GitHub Desktop.
Save shaneis/0509ba3dba46d1887baacc81c8c0b7a5 to your computer and use it in GitHub Desktop.
what what you got does
IF OBJECT_ID(N'dbo.WhatYouGot', N'P') IS NOT NULL DROP PROCEDURE dbo.WhatYouGot;
GO
CREATE PROCEDURE dbo.WhatYouGot
AS
BEGIN
IF OBJECT_ID(N'tempdb.dbo.#temp', N'U') IS NOT NULL DROP TABLE #temp;
CREATE TABLE #temp (
id tinyint NOT NULL DEFAULT 1,
details varchar(50) NOT NULL DEFAULT 'A head full of stupid ideas :)'
);
INSERT INTO #temp DEFAULT VALUES;
SELECT id, details FROM #temp
END;
GO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment