--Defragmantasyon oranı sorgulama ve otomatik düzeltme
Use TEST_DB
GO
DECLARE @Table VARCHAR(255)
DECLARE @cmd NVARCHAR(500)
DECLARE @fillfactor INT
SET @fillfactor = 90
DECLARE cr_Kayitlar CURSOR FOR
SELECT OBJECT_NAME (ps.object_id) as ObjectName --,ps.avg_fragmentation_in_percent
FROM sys.dm_db_index_physical_stats (DB_ID(), NULL, NULL , NULL, 'LIMITED') ps
INNER JOIN sys.indexes i ON i.object_id=ps.object_id and i.index_id=ps.index_id
...
1 ay önce