Changeset 12761 for branches/HiveStatistics/sources/HeuristicLab.Services.Hive.DataAccess/3.3/Manager
- Timestamp:
- 07/14/15 15:56:26 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.DataAccess/3.3/Manager/PersistenceManager.cs
r12691 r12761 22 22 using System; 23 23 using System.Data.Linq; 24 using System.Linq; 24 25 using System.Transactions; 25 26 using HeuristicLab.Services.Hive.DataAccess.Daos; 26 27 using HeuristicLab.Services.Hive.DataAccess.Daos.HiveStatistics; 28 using HeuristicLab.Services.Hive.DataAccess.Data; 27 29 using HeuristicLab.Services.Hive.DataAccess.Interfaces; 28 30 … … 200 202 #endregion 201 203 204 // str.Remove(str.IndexOf(',')); 205 public TableInformation GetTableInformation(string table) { 206 string query = string.Format("sp_spaceused '{0}', @updateusage='true'", table); 207 var result = dataContext.ExecuteQuery<SqlServerTableInformation>(query).FirstOrDefault(); 208 if (result == null) return null; 209 return new TableInformation { 210 Name = result.Name, 211 Rows = int.Parse(result.Rows.Remove(result.Rows.IndexOf(' '))), 212 Reserved = int.Parse(result.Reserved.Remove(result.Reserved.IndexOf(' '))), 213 Data = int.Parse(result.Data.Remove(result.Data.IndexOf(' '))), 214 IndexSize = int.Parse(result.Index_Size.Remove(result.Index_Size.IndexOf(' '))), 215 Unused = int.Parse(result.Unused.Remove(result.Unused.IndexOf(' '))) 216 }; 217 } 218 202 219 public void SubmitChanges() { 203 220 if (dataContext != null) { … … 211 228 //} 212 229 } 230 231 private class SqlServerTableInformation { 232 public string Name { get; set; } 233 public string Rows { get; set; } 234 public string Reserved { get; set; } 235 public string Data { get; set; } 236 public string Index_Size { get; set; } // naming of sp_spaceused... 237 public string Unused { get; set; } 238 } 213 239 } 214 240 }
Note: See TracChangeset
for help on using the changeset viewer.