Last active
July 13, 2020 14:20
-
-
Save Migaroez/86407a264394bd01913ef4de1a408e1c to your computer and use it in GitHub Desktop.
Umbraco forms junk cleanup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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