Skip to content

Instantly share code, notes, and snippets.

@ChrisMoney
Created December 2, 2024 17:45
Show Gist options
  • Save ChrisMoney/33dac5dbe41f521a4922ca5f7b721096 to your computer and use it in GitHub Desktop.
Save ChrisMoney/33dac5dbe41f521a4922ca5f7b721096 to your computer and use it in GitHub Desktop.
Rename Stored Proc
USE [Database_Name] GO --
Check if the procedure exists before renaming
IF OBJECT_ID('dbo.AdminReportsStaples', 'P') IS NOT NULL
BEGIN
EXEC sp_rename 'dbo.AdminReportsStaples', 'AdminReportsRevenue'
END
ELSE
BEGIN
PRINT 'Procedure dbo.AdminReportsStaples does not exist.'
END
GO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment