Menu

Skip to content
Sytone's Ramblings
  • Home
  • About

Sytone's Ramblings

the occasional posts of a guy who plays with technology

Deleting Content Types in SharePoint

Posted on June 22, 2010 by Sytone

I found this peice of SQL on the web a while ago, I have no idea where it came from but it did come in handy the other day when a client needed to delete a content type but kept on getting the message it was in use.

When deleting content types you need to ensure:

  • All items using the type are deleted (and deleted from the recycle bin)
  • The Content type is removed from any list using it.
  • Any Page Layouts using the type nolonger reference it.

To help track down where the content type is in use the following query will help.

DECLARE @ContentTypeName nvarchar(128)
SET @ContentTypeName='ABCC.CourtCasePage'
SELECT w.Title AS [Web Site], w.FullUrl AS [Web Url], al.tp_Title AS [List Title], ct2.*
FROM ContentTypes ct1
JOIN ContentTypes ct2
      ON LEFT(ct2.ContentTypeId, Len(ct1.ContentTypeId))=ct1.ContentTypeId
LEFT OUTER JOIN dbo.ContentTypeUsage ctu
      ON LEFT(ctu.ContentTypeId, Len(ct2.ContentTypeId)) = ct2.ContentTypeId
LEFT OUTER JOIN dbo.AllLists al
      ON ctu.ListId = al.tp_Id AND ctu.WebId=al.tp_WebId
LEFT OUTER JOIN dbo.Webs w
      ON al.tp_WebId = w.Id
WHERE ct1.ResourceDir=@ContentTypeName

Share this:

  • Email
  • Print
  • Reddit
  • Twitter
  • Pocket
  • Pinterest
Posted in General | Leave a comment

When is true not true?

Posted on May 31, 2010 by Sytone

When you look at true stored in the .Net framework.

While playing with Pex I found out a interesting fact that the bool is a byte in the MSIL. Which means that a bool could be euqal to anything on the byte range… Now this would require you to go out of your way and create unsafe code blocks to do this. Why you would do this… No ideas 🙂

Its marked as a no-fix which is not supprising as I would not fix it either becase as they say, if you know about this and you use it then you are on your own..

https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=455553&wa=wsignin1.0

http://blog.dotnetwiki.org/2009/05/29/TamingThePexBeastWellbehavedEnumsMultidimensionalArraysAndBooleans.aspx

Share this:

  • Email
  • Print
  • Reddit
  • Twitter
  • Pocket
  • Pinterest
Posted in General | Tagged c# development | Leave a comment

Toodledo DF – Update

Posted on May 27, 2010 by Sytone

Information can be found on: http://www.sytone.com/toodledo-distraction-free/

Share this:

  • Email
  • Print
  • Reddit
  • Twitter
  • Pocket
  • Pinterest
Posted in General | Tagged development toodledo | 1 Comment

Post navigation

  • Older posts
  • Newer posts

Tags

API autohotkey Binding c# cache Content Deployment development engineering forge Games General Gnomoria hack Home Assistant Home Automation hosting ISO ISY JSON libraries Microsoft Microsoft Flow minecraft MoCA mod network openhab outlook paper PowerShell REST Security SharePoint site SQL toodledo troubleshooting Tweak Visual Studio Visual Studio Code windows 7 Windows 8 Windows Phone winkhub XAML

Recent Posts

  • iPhone hotspot issues? Getting it to work with windows.
  • Getting a DietPi image running on Hyper-V
  • Getting HP Officejet Pro 8620 scan to network working…
  • Developing Home Assistant on Windows using the Subsystem for Linux
  • Using Microsoft Flow with Home Assistant

Recent Comments

  • Shrabean on Automating OneNote with AutoHotKey to be a Journal V1.1
  • danbutter on Integrating ISY into OpenHAB
  • Sytone on Integrating ISY into OpenHAB
  • rick Sumter on Integrating ISY into OpenHAB
  • Sytone on Automating OneNote with AutoHotKey to be a Journal V1.1

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org
Proudly powered by WordPress
Theme: Flint by Star Verte LLC
loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.