From 281955949910eb257b5f7e42e54535ba7812418e Mon Sep 17 00:00:00 2001
From: Melanie Thielker
Date: Sun, 14 Sep 2008 13:23:02 +0000
Subject: Mantis #2124 Thank you, RuudL, for a patch that brings MSSQL up to
 the same implementation level as MySQL.

---
 OpenSim/Data/MSSQL/Resources/002_AssetStore.sql | 29 +++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
 create mode 100644 OpenSim/Data/MSSQL/Resources/002_AssetStore.sql

(limited to 'OpenSim/Data/MSSQL/Resources/002_AssetStore.sql')

diff --git a/OpenSim/Data/MSSQL/Resources/002_AssetStore.sql b/OpenSim/Data/MSSQL/Resources/002_AssetStore.sql
new file mode 100644
index 0000000..3e24543
--- /dev/null
+++ b/OpenSim/Data/MSSQL/Resources/002_AssetStore.sql
@@ -0,0 +1,29 @@
+BEGIN TRANSACTION
+
+CREATE TABLE Tmp_assets
+	(
+	id varchar(36) NOT NULL,
+	name varchar(64) NOT NULL,
+	description varchar(64) NOT NULL,
+	assetType tinyint NOT NULL,
+	local bit NOT NULL,
+	temporary bit NOT NULL,
+	data image NOT NULL
+	)  ON [PRIMARY]
+	 TEXTIMAGE_ON [PRIMARY]
+
+IF EXISTS(SELECT * FROM assets)
+	 EXEC('INSERT INTO Tmp_assets (id, name, description, assetType, local, temporary, data)
+		SELECT id, name, description, assetType, CONVERT(bit, local), CONVERT(bit, temporary), data FROM assets WITH (HOLDLOCK TABLOCKX)')
+
+DROP TABLE assets
+
+EXECUTE sp_rename N'Tmp_assets', N'assets', 'OBJECT' 
+
+ALTER TABLE dbo.assets ADD CONSTRAINT
+	PK__assets__id PRIMARY KEY CLUSTERED 
+	(
+	id
+	) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
+
+COMMIT
-- 
cgit v1.1

