Quantcast
Channel: Rss Feed - SSMSBoost Add-in discussion board - Forum
Viewing all articles
Browse latest Browse all 823

Create or Alter Procedure Block Auto Replace

$
0
0
I use this auto replace typing "cora" when creating a new stored procedure so that it creates the procedure if it doesn't exist and alters it if it does.


Code:
IF OBJECT_ID('<object name, sysname, dbo. >') IS NULL -- Check if SP Exists
 EXEC('CREATE PROCEDURE <object name, sysname, dbo. > AS SET NOCOUNT ON;')
GO

ALTER PROCEDURE <object name, sysname, dbo. > -- Alter the SP Always 
--PARAMETERS HERE
AS 
BEGIN
SET NOCOUNT ON


END

GO
Go to last post

Viewing all articles
Browse latest Browse all 823

Trending Articles