aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MSSQL/Resources/019_RegionStore.sql
blob: 8e613b9d09a9a9899d6ae9b80e8ca3ef174222af (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_regionban
	(
	regionUUID uniqueidentifier NOT NULL,
	bannedUUID uniqueidentifier NOT NULL,
	bannedIp varchar(16) NOT NULL,
	bannedIpHostMask varchar(16) NOT NULL
	)  ON [PRIMARY]

IF EXISTS(SELECT * FROM dbo.regionban)
	 EXEC('INSERT INTO dbo.Tmp_regionban (regionUUID, bannedUUID, bannedIp, bannedIpHostMask)
		SELECT CONVERT(uniqueidentifier, regionUUID), CONVERT(uniqueidentifier, bannedUUID), bannedIp, bannedIpHostMask FROM dbo.regionban WITH (HOLDLOCK TABLOCKX)')

DROP TABLE dbo.regionban

EXECUTE sp_rename N'dbo.Tmp_regionban', N'regionban', 'OBJECT' 

COMMIT