Ver Mensaje Individual
  #4 (permalink)  
Antiguo 21/10/2015, 07:56
Avatar de Libras
Libras
Colaborador
 
Fecha de Ingreso: agosto-2006
Ubicación: En la hermosa perla de occidente
Mensajes: 7.412
Antigüedad: 18 años, 3 meses
Puntos: 774
Respuesta: Borrar file y file group tabla particionada - Transact-SQL

Lo que pasa es que cuando hiciste el switch de la particion moviste los datos que estaban en la particion 1, normalmente la particion 1 se reserva para el sistema, y no estas revisando en que particion estan tus datos, prueba con este query para obtener el numero de renglones por particion y revisar cual es el numero de particion que quieres mover:

Código SQL:
Ver original
  1. SELECT
  2. DB_NAME() AS 'DatabaseName'
  3. ,OBJECT_NAME(p.OBJECT_ID) AS 'TableName'
  4. ,p.index_id AS 'IndexId'
  5. ,CASE
  6. WHEN p.index_id = 0 THEN 'HEAP'
  7. ELSE i.name
  8. END AS 'IndexName'
  9. ,p.partition_number AS 'PartitionNumber'
  10. ,prv_left.VALUE AS 'LowerBoundary'
  11. ,prv_right.VALUE AS 'UpperBoundary'
  12. ,CASE
  13. WHEN fg.name IS NULL THEN ds.name
  14. ELSE fg.name
  15. END AS 'FileGroupName'
  16. ,CAST(p.used_page_count * 0.0078125 AS NUMERIC(18,2)) AS 'UsedPages_MB'
  17. ,CAST(p.in_row_data_page_count * 0.0078125 AS NUMERIC(18,2)) AS 'DataPages_MB'
  18. ,CAST(p.reserved_page_count * 0.0078125 AS NUMERIC(18,2)) AS 'ReservedPages_MB'
  19. ,CASE
  20. WHEN p.index_id IN (0,1) THEN p.ROW_COUNT
  21. ELSE 0
  22. END AS 'RowCount'
  23. ,CASE
  24. WHEN p.index_id IN (0,1) THEN 'data'
  25. ELSE 'index'
  26. END 'Type'
  27. FROM sys.dm_db_partition_stats p
  28. INNER JOIN sys.indexes i
  29. ON i.OBJECT_ID = p.OBJECT_ID AND i.index_id = p.index_id
  30. INNER JOIN sys.data_spaces ds
  31. ON ds.data_space_id = i.data_space_id
  32. LEFT OUTER JOIN sys.partition_schemes ps
  33. ON ps.data_space_id = i.data_space_id
  34. LEFT OUTER JOIN sys.destination_data_spaces dds
  35. ON dds.partition_scheme_id = ps.data_space_id
  36. AND dds.destination_id = p.partition_number
  37. LEFT OUTER JOIN sys.filegroups fg
  38. ON fg.data_space_id = dds.data_space_id
  39. LEFT OUTER JOIN sys.partition_range_values prv_right
  40. ON prv_right.function_id = ps.function_id
  41. AND prv_right.boundary_id = p.partition_number
  42. LEFT OUTER JOIN sys.partition_range_values prv_left
  43. ON prv_left.function_id = ps.function_id
  44. AND prv_left.boundary_id = p.partition_number - 1
  45. WHERE
  46. OBJECTPROPERTY(p.OBJECT_ID, 'ISMSSHipped') = 0

ahora mencionas que el dbcc marca errores, que tipo de errores??
__________________
What does an execution plan say to t-sql query? Go f**k yourself, if you are not happy with me