1
0

010_UserStore.sql 830 B

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