1
0

016_RegionStore.sql 489 B

12345678910111213141516171819
  1. BEGIN TRANSACTION
  2. CREATE TABLE dbo.Tmp_terrain
  3. (
  4. RegionUUID uniqueidentifier NULL,
  5. Revision int NULL,
  6. Heightfield image NULL
  7. ) ON [PRIMARY]
  8. TEXTIMAGE_ON [PRIMARY]
  9. IF EXISTS(SELECT * FROM dbo.terrain)
  10. EXEC('INSERT INTO dbo.Tmp_terrain (RegionUUID, Revision, Heightfield)
  11. SELECT CONVERT(uniqueidentifier, RegionUUID), Revision, Heightfield FROM dbo.terrain WITH (HOLDLOCK TABLOCKX)')
  12. DROP TABLE dbo.terrain
  13. EXECUTE sp_rename N'dbo.Tmp_terrain', N'terrain', 'OBJECT'
  14. COMMIT