Created
October 5, 2017 19:53
-
-
Save yzorg/d7d84318699f1b43017bd0f46ac176e4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 [MyAppDatabase] | |
GO | |
IF NOT EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND OBJECT_ID = OBJECT_ID('dbo.spAppUserSave')) | |
EXEC('CREATE PROCEDURE [dbo].[spAppUserSave] AS BEGIN SET NOCOUNT ON; /* invalid empty SPROC */ END') | |
GO | |
SET ANSI_NULLS OFF | |
SET QUOTED_IDENTIFIER OFF | |
GO | |
-- Author: Chris Tracy | |
ALTER PROCEDURE [dbo].[spAppUserSave] | |
@CurrentUser NVARCHAR(MAX), | |
@UserId BIGINT | |
-- ... | |
AS | |
BEGIN | |
SET NOCOUNT OFF; | |
-- do real SPROC work here | |
END | |
GO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've had to re-create the top
IF .. EXISTS ... EXEC('CREATE PROC..'
many times (when I wipe my computer, or change jobs). The rest is just template for basic syntax.