Last active
November 9, 2016 02:08
-
-
Save nullbind/0f27ec202831e9ba28cd675c7deca863 to your computer and use it in GitHub Desktop.
How to set the "is_ms_shipped" flag to one for custom stored procedures in SQL Server.
This file contains 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
This outlines how to set the "is_ms_shipped" flag to one for custom stored procedures in SQL Server. | |
Note: The following has to be executed as a sysadmin | |
-- Create stored procedure | |
CREATE PROCEDURE sp_example | |
AS | |
BEGIN | |
SELECT @@VERSION | |
END | |
-- Check properties of proc | |
SELECT name,is_ms_shipped FROM sys.procedures WHERE name = 'sp_example' | |
-- Flag the procedure as a system object via a DAC connection via | |
-- Note: This changes the proc to a system object, but doesn't change from the dbo to sys schema. | |
-- Source: https://raresql.com/tag/sp_ms_marksystemobject/ | |
exec sys.sp_ms_marksystemobject sp_example | |
-- Check properties of proc | |
SELECT name,is_ms_shipped FROM sys.procedures WHERE name = 'sp_example' | |
Note: To remove the flag the procedures need to be dropped and recreated. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment