Index: /branches/HivePerformance/sources/HeuristicLab.Services.Hive.DataAccess/3.3/HeuristicLab.Services.Hive.DataAccess-3.3.csproj
===================================================================
--- /branches/HivePerformance/sources/HeuristicLab.Services.Hive.DataAccess/3.3/HeuristicLab.Services.Hive.DataAccess-3.3.csproj	(revision 9484)
+++ /branches/HivePerformance/sources/HeuristicLab.Services.Hive.DataAccess/3.3/HeuristicLab.Services.Hive.DataAccess-3.3.csproj	(revision 9485)
@@ -149,4 +149,5 @@
   <ItemGroup>
     <Content Include="SQL Scripts\Initialize Hive Database.sql" />
+    <Content Include="SQL Scripts\Migrate to Filestream.sql" />
     <Content Include="SQL Scripts\Prepare Hive Database.sql" />
   </ItemGroup>
Index: /branches/HivePerformance/sources/HeuristicLab.Services.Hive.DataAccess/3.3/SQL Scripts/Migrate to Filestream.sql
===================================================================
--- /branches/HivePerformance/sources/HeuristicLab.Services.Hive.DataAccess/3.3/SQL Scripts/Migrate to Filestream.sql	(revision 9485)
+++ /branches/HivePerformance/sources/HeuristicLab.Services.Hive.DataAccess/3.3/SQL Scripts/Migrate to Filestream.sql	(revision 9485)
@@ -0,0 +1,73 @@
+USE [HeuristicLab.Hive-3.3]
+
+
+/**********************************************************/
+
+/* Move old Task Data */
+
+CREATE TABLE [dbo].[TaskDataTemp](
+  [TaskId] UniqueIdentifier RowGuidCol NOT NULL,
+  [Data] VarBinary(MAX) Filestream NOT NULL,
+  [LastUpdate] DateTime NOT NULL,
+  CONSTRAINT [PK_dbo.TaskDataTemp] PRIMARY KEY ([TaskId])
+)
+  
+INSERT INTO dbo.TaskDataTemp (TaskId, Data, LastUpdate)
+SELECT TaskId, Data, LastUpdate
+FROM dbo.TaskData
+
+DELETE FROM dbo.TaskData
+
+/* Alter TaskId and Data Column */
+
+ALTER TABLE dbo.TaskData
+ALTER COLUMN [TaskId] ADD RowGuidCol
+
+ALTER TABLE dbo.TaskData
+DROP COLUMN Data
+
+ALTER TABLE dbo.TaskData
+ADD [Data] VarBinary(MAX) Filestream NOT NULL
+
+/* Insert data */
+
+INSERT INTO dbo.TaskData (TaskId, Data, LastUpdate)
+SELECT TaskId, Data, LastUpdate
+FROM dbo.TaskDataTemp
+
+DROP TABLE dbo.TaskDataTemp
+
+
+/**********************************************************/
+
+/* Move old Plugin Data */
+
+CREATE TABLE [dbo].[PluginDataTemp](
+  [PluginDataId] UniqueIdentifier RowGuidCol NOT NULL,
+  [PluginId] UniqueIdentifier NOT NULL,
+  [Data] VarBinary(MAX) FileStream NOT NULL,
+  [FileName] VarChar(MAX) NOT NULL,
+  CONSTRAINT [PK_dbo.PluginDataTemp] PRIMARY KEY ([PluginDataId])
+)
+  
+INSERT INTO dbo.PluginDataTemp (PluginDataId, PluginId, Data, [FileName])
+SELECT PluginDataId, PluginId, Data, [FileName]
+FROM dbo.PluginData
+
+DELETE FROM dbo.PluginData
+
+/* Alter Data Column */
+
+ALTER TABLE dbo.PluginData
+DROP COLUMN Data
+
+ALTER TABLE dbo.PluginData
+ADD [Data] VarBinary(MAX) Filestream NOT NULL
+
+/* Insert data */
+
+INSERT INTO dbo.PluginData (PluginDataId, PluginId, Data, [FileName])
+SELECT PluginDataId, PluginId, Data, [FileName]
+FROM dbo.PluginDataTemp
+
+DROP TABLE dbo.PluginDataTemp
Index: /branches/HivePerformance/sources/HeuristicLab.Services.Hive/3.3/OptimizedHiveDao.cs
===================================================================
--- /branches/HivePerformance/sources/HeuristicLab.Services.Hive/3.3/OptimizedHiveDao.cs	(revision 9484)
+++ /branches/HivePerformance/sources/HeuristicLab.Services.Hive/3.3/OptimizedHiveDao.cs	(revision 9485)
@@ -241,9 +241,9 @@
 
     public bool SlaveHasToShutdownComputer(Guid slaveId) {
-      return Db.ExecuteQuery<int>(DowntimeQueryString, slaveId, DateTime.Now, DowntimeType.Shutdown).First() > 0;
+      return Db.ExecuteQuery<int>(DowntimeQueryString, slaveId, DateTime.Now, DowntimeType.Shutdown.ToString()).FirstOrDefault() > 0;
     }
 
     public bool SlaveIsAllowedToCalculate(Guid slaveId) {
-      return Db.ExecuteQuery<int>(DowntimeQueryString, slaveId, DateTime.Now, DowntimeType.Offline).First() == 0;
+      return Db.ExecuteQuery<int>(DowntimeQueryString, slaveId, DateTime.Now, DowntimeType.Offline.ToString()).FirstOrDefault() == 0;
     }
     #endregion
