• You can see some basic information for the processes responsible for the growth of TempDB by querying the default trace. The following query will show the SPID, Login, Host Name from which the request originated, and some other information for the process(es) responsible for causing TempDB to grow:

    SELECT TE.name AS [EventName],T.DatabaseName, t.DatabaseID, t.NTDomainName,

    t.ApplicationName, t.LoginName, t.HostName,t.SPID, t.Duration, t.StartTime, t.EndTime,

    t.textdata

    FROM sys.fn_trace_gettable (CONVERT(VARCHAR(150), (SELECT TOP 1 f.[value]

    FROM sys.fn_trace_getinfo(NULL) f

    WHERE f.property = 2

    )), DEFAULT) T

    JOIN sys.trace_events TE ON T.EventClass = TE.trace_event_id

    where te.name ='data file auto grow' and DatabaseID=2

    ORDER BY t.StartTime;

    From there, you can use that information to ferret out the offending query in a couple ways.

    If the growth happens frequently and activity on the server is not too busy, it might be worth it to start a trace so that you can correlate the Start Time and SPID from the default trace Auto Grow events with a specific piece of T-SQL.

    Otherwise, you would have to catch the activity as it is happening, or hunt around in sys.dm_exec_query_stats to find a query

    that correlates with the times TempDB was growing. Of course, that will only work if the query is still in the cache by the time you investigate.

    Cheers!