Skip to content

Instantly share code, notes, and snippets.

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 nullbind/0f27ec202831e9ba28cd675c7deca863 to your computer and use it in GitHub Desktop.
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 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