SQLAgent.out

  • Hello dears,

    how can find size of sqlagent.out file by t-sql? or

    how can write a t-sql command for find size of sqlagent.out in sqlserver2000?

    Best Regards,

    zohreh

  • try this

    create table #t(list varchar(100))

    insert into #t(list)

    exec xp_cmdshell 'dir /-C "c:\Program Files\Microsoft SQL Server\MSSQL\LOG\sqlagent.out"'

    declare @size Int

    Select

    cast(replace(Substring(t.list, 20, Len(t.list) - 20 - 12), ' ', '') As Int)

    From

    #t t

    Where

    CharIndex('sqlagent.out', t.list) > 0

    drop table #t

    I Have Nine Lives You Have One Only
    THINK!

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

You must be logged in to reply to this topic. Login to reply