/* Originally based on script from https://our.umbraco.org/projects/developer-tools/sql-scripts */ /* Use to create missing PropertyData entries if the Umbraco UI gives a timeout error when trying * to add a new property to an existing document type */ Declare @ContentTypeAlias nvarchar(255), @PropertyTypeAlias nvarchar(255) Set @ContentTypeAlias = 'nodeTypeAlias' Set @PropertyTypeAlias = 'propertyTypeAlias' Declare @ContentTypeId int, @PropertyTypeId int Set @ContentTypeId = ( Select top 1 nodeId From cmsContentType Where Alias = @ContentTypeAlias ) Set @PropertyTypeId = ( Select top 1 id From cmsPropertyType Where Alias = @PropertyTypeAlias AND contentTypeId = @ContentTypeId ) /* Uncomment the following line when ready to insert the records. */ --Insert Into cmsPropertyData (versionId, contentNodeId, propertytypeid) Select cmsContentVersion.VersionId, cmsContentVersion.ContentId , @PropertyTypeId From cmsContentVersion Inner Join cmsContent on cmsContentVersion.ContentId = cmsContent.nodeId Where cmsContent.contentType = @ContentTypeId and Not Exists ( Select versionId, contentNodeId, propertytypeid From cmsPropertyData propertyData Where propertyData.versionId = cmsContentVersion.versionId and propertyData.contentNodeId = cmsContentVersion.ContentId and propertyData.propertytypeid = @PropertyTypeId )