Skip to content

Instantly share code, notes, and snippets.

@rezanid
Created January 14, 2020 13:52
Show Gist options
  • Save rezanid/c704bab16466e611af34db17e02714d1 to your computer and use it in GitHub Desktop.
Save rezanid/c704bab16466e611af34db17e02714d1 to your computer and use it in GitHub Desktop.
Find a ContentType in SharePoint DB
SELECT [SiteId]
,[Class]
,[Scope]
,sys.fn_varbintohexstr([ContentTypeId]) as CT
,[Version]
,[NextChildByte]
,[Size]
,[Definition]
,[ResourceDir]
,[IsFromFeature]
FROM WSS_Content_DB1.[dbo].[ContentTypes]
where (sys.fn_varbintohexstr(ContentTypeId) = '0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF3900CE1DDB656E9B44BB92054FBA875313E5')
--SELECT * FROM ContentTypeUsage WHERE ContentTypeId = '0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF3900CE1DDB656E9B44BB92054FBA875313E5';
-- Update WSS_Content_DB1.[dbo].[ContentTypes] set [IsFromFeature] = 0 where (sys.fn_varbintohexstr(ContentTypeId) = '0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF3900CE1DDB656E9B44BB92054FBA875313E5')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment