Viewing 5 posts - 1 through 5 (of 5 total)
Hi sorry, I had been looking all afternoon, and had sorted it myself, though goodness knows how, as I'm new to all this coding, so many thanks.
Even though the results...
June 14, 2010 at 8:55 am
Hi guys, ok here is what I have so far.
EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'Administrator',
@recipients = 'gary.jenkinson01@rotherham.gov.uk',
@subject = 'Fragmentation Results'...
June 14, 2010 at 7:19 am
Hi, get the same error using the other method, so it must be something about the sql code.
Every thing else seems to be ok
Cheers
June 14, 2010 at 6:26 am
Hi Ok I have something that kind of works, see below.
IF EXISTS (SELECT * FROM tempdb..sysobjects
WHERE id = object_id(N'[tempdb]..[#FragDetails]'))
DROP TABLE #FragDetails
USE RotherhamRecruit_Training
GO
SELECT OBJECT_NAME(i.OBJECT_ID) AS TableName,
i.name AS IndexName,
indexstats.avg_fragmentation_in_percent
INTO #FragDetails
FROM sys.dm_db_index_physical_stats(DB_ID(), NULL,...
June 14, 2010 at 5:19 am
Viewing 5 posts - 1 through 5 (of 5 total)