Skip to content

Instantly share code, notes, and snippets.

@Migaroez
Last active July 13, 2020 14:20
Show Gist options
  • Select an option

  • Save Migaroez/86407a264394bd01913ef4de1a408e1c to your computer and use it in GitHub Desktop.

Select an option

Save Migaroez/86407a264394bd01913ef4de1a408e1c to your computer and use it in GitHub Desktop.
Umbraco forms junk cleanup
DECLARE @PartialRecordData varchar(max);
SET @PartialRecordData = '%mail.ru%';
SELECT *
FROM [UFRecords]
where RecordData like @PartialRecordData
SELECT *
FROM [UFRecordFields]
where Record in (SELECT Record
FROM [UFRecords]
where RecordData like @PartialRecordData
)
Select * from [UFRecordDataString]
where [Key] in (SELECT [Key]
FROM [UFRecordFields]
where Record in (SELECT Record
FROM [UFRecords]
where RecordData like @PartialRecordData
))
Select * from [UFRecordDataLongString]
where [Key] in (SELECT [Key]
FROM [UFRecordFields]
where Record in (SELECT Record
FROM [UFRecords]
where RecordData like @PartialRecordData
))
Select * from [UFRecordDataInteger]
where [Key] in (SELECT [Key]
FROM [UFRecordFields]
where Record in (SELECT Record
FROM [UFRecords]
where RecordData like @PartialRecordData
))
Select * from [UFRecordDataDateTime]
where [Key] in (SELECT [Key]
FROM [UFRecordFields]
where Record in (SELECT Record
FROM [UFRecords]
where RecordData like @PartialRecordData
))
Select * from [UFRecordDataBit]
where [Key] in (SELECT [Key]
FROM [UFRecordFields]
where Record in (SELECT Record
FROM [UFRecords]
where RecordData like @PartialRecordData
))
=================
DECLARE @PartialRecordData varchar(max);
SET @PartialRecordData = '%mail.ru%';
Delete from [UFRecordDataString]
where [Key] in (SELECT [Key]
FROM [UFRecordFields]
where Record in (SELECT Record
FROM [UFRecords]
where RecordData like @PartialRecordData
))
Delete from [UFRecordDataLongString]
where [Key] in (SELECT [Key]
FROM [UFRecordFields]
where Record in (SELECT Record
FROM [UFRecords]
where RecordData like @PartialRecordData
))
Delete from [UFRecordDataInteger]
where [Key] in (SELECT [Key]
FROM [UFRecordFields]
where Record in (SELECT Record
FROM [UFRecords]
where RecordData like @PartialRecordData
))
Delete from [UFRecordDataDateTime]
where [Key] in (SELECT [Key]
FROM [UFRecordFields]
where Record in (SELECT Record
FROM [UFRecords]
where RecordData like @PartialRecordData
))
Delete from [UFRecordDataBit]
where [Key] in (SELECT [Key]
FROM [UFRecordFields]
where Record in (SELECT Record
FROM [UFRecords]
where RecordData like @PartialRecordData
))
Delete
FROM [UFRecordFields]
where Record in (SELECT Record
FROM [UFRecords]
where RecordData like @PartialRecordData
)
Delete
FROM [UFRecords]
where RecordData like @PartialRecordData
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment