Forum Replies Created

Viewing 5 posts - 1 through 5 (of 5 total)

  • RE: Reindexing with email results

    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...

  • RE: Reindexing with email results

    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'...

  • RE: Reindexing with email results

    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

  • RE: Reindexing with email results

    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,...

  • RE: Reindexing with email results

    Cheers thanks for the pointers.

Viewing 5 posts - 1 through 5 (of 5 total)