Skip to content

Instantly share code, notes, and snippets.

@jamescoxhead
jamescoxhead / UmbracoUnusedDatatypes.sql
Last active November 23, 2016 12:59
Lists Umbraco datatypes which haven't been used on document types. Care is needed if using packages like Archetype as this script will show datatypes as unused if they are only used on an archetype.
SELECT distinct [nodeId]
FROM [cmsDataType]
EXCEPT
SELECT distinct dataTypeId
FROM [cmsPropertyType]
@Hendy
Hendy / DeleteAllVersions.sql
Last active October 28, 2020 10:10
Umbraco - delete version history for all content
-- Create a temporary table for all documents which are published and not in the recycle bin
CREATE TABLE #Nodes (id int)
-- Delete all rows if the table exists before
TRUNCATE TABLE #Nodes
-- Insert all nodeIds from all documents which are published and not in the recycle bin
INSERT INTO #Nodes
SELECT N.id
FROM umbracoNode N
INNER JOIN cmsDocument D ON N.ID = D.NodeId
@csharpforevermore
csharpforevermore / CustomGlobal.cs
Created January 12, 2015 04:20
Custom Global.asax.cs for Umbraco 7
public class CustomGlobal : UmbracoApplication
{
public void Init(HttpApplication application)
{
application.PreRequestHandlerExecute += application_PreRequestHandlerExecute;
application.BeginRequest += this.Application_BeginRequest;
application.EndRequest += this.Application_EndRequest;
application.Error += Application_Error;
}