* Changes varchar(36) columns to UUID type in MSSQL - this will be much more efficient
* ===As always, please, please backup your database before applying this patch===
* Thanks Ruud Lathrop (for the patch) and StrawberryFride (for the review)
This commit is contained in:
Justin Clarke Casey
2009-02-19 18:09:10 +00:00
parent 06ece33bee
commit 0760956561
30 changed files with 1125 additions and 180 deletions

View File

@@ -0,0 +1,19 @@
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_terrain
(
RegionUUID uniqueidentifier NULL,
Revision int NULL,
Heightfield image NULL
) ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.terrain)
EXEC('INSERT INTO dbo.Tmp_terrain (RegionUUID, Revision, Heightfield)
SELECT CONVERT(uniqueidentifier, RegionUUID), Revision, Heightfield FROM dbo.terrain WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.terrain
EXECUTE sp_rename N'dbo.Tmp_terrain', N'terrain', 'OBJECT'
COMMIT