[DiscordArchive] Would this change all instances of character GUID & thereby reorder login screen chars without brick
[DiscordArchive] Would this change all instances of character GUID & thereby reorder login screen chars without brick
Archived author: Cyanide • Posted: 2024-01-14T12:34:37.214000+00:00
Original source
Would this change all instances of character GUID & thereby reorder login screen chars without bricking the char?
```DECLARE @OldGUID UNIQUEIDENTIFIER = 'old-guid-value'; -- Replace with current GUID
DECLARE @NewGUID UNIQUEIDENTIFIER = 'new-guid-value'; -- Replace with the new GUID
DECLARE @TableName NVARCHAR(256);
DECLARE @ColumnName NVARCHAR(256);
DECLARE @SQL NVARCHAR(MAX);
DECLARE TableCursor CURSOR FOR
SELECT t.name, c.name
FROM sys.tables t
JOIN sys.columns c ON t.object_id = c.object_id
WHERE c.name = 'GUID';
OPEN TableCursor;
FETCH NEXT FROM TableCursor INTO @TableName, @ColumnName;
WHILE @@FETCH_STATUS = 0
BEGIN
SET @SQL = N'UPDATE ' + QUOTENAME(@TableName)
+ N' SET ' + QUOTENAME(@ColumnName) + N' = ''' + CAST(@NewGUID AS NVARCHAR(36)) + N''''
+ N' WHERE ' + QUOTENAME(@ColumnName) + N' = ''' + CAST(@OldGUID AS NVARCHAR(36)) + N'''';
EXEC sp_executesql @SQL;
FETCH NEXT FROM TableCursor INTO @TableName, @ColumnName;
END;
CLOSE TableCursor;
DEALLOCATE TableCursor;
```
Would this change all instances of character GUID & thereby reorder login screen chars without bricking the char?