aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MSSQL/Resources/016_RegionStore.sql
blob: e91da19b120ab67bc54b5f7b788e942bf069fba5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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