1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_avatarattachments
(
UUID uniqueidentifier NOT NULL,
attachpoint int NOT NULL,
item uniqueidentifier NOT NULL,
asset uniqueidentifier NOT NULL
) ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.avatarattachments)
EXEC('INSERT INTO dbo.Tmp_avatarattachments (UUID, attachpoint, item, asset)
SELECT CONVERT(uniqueidentifier, UUID), attachpoint, CONVERT(uniqueidentifier, item), CONVERT(uniqueidentifier, asset) FROM dbo.avatarattachments WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.avatarattachments
EXECUTE sp_rename N'dbo.Tmp_avatarattachments', N'avatarattachments', 'OBJECT'
CREATE NONCLUSTERED INDEX IX_avatarattachments ON dbo.avatarattachments
(
UUID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT
|