From 07609565617aa7936758acba5fd625877564a10d Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Thu, 19 Feb 2009 18:09:10 +0000 Subject: * Apply http://opensimulator.org/mantis/view.php?id=3142 * 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) --- OpenSim/Data/MSSQL/Resources/016_RegionStore.sql | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 OpenSim/Data/MSSQL/Resources/016_RegionStore.sql (limited to 'OpenSim/Data/MSSQL/Resources/016_RegionStore.sql') diff --git a/OpenSim/Data/MSSQL/Resources/016_RegionStore.sql b/OpenSim/Data/MSSQL/Resources/016_RegionStore.sql new file mode 100644 index 0000000..e91da19 --- /dev/null +++ b/OpenSim/Data/MSSQL/Resources/016_RegionStore.sql @@ -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 -- cgit v1.1