Forum Replies Created

Viewing post 1 (of 2 total)

  • RE: How to find last accessed date time of a SQL Server 2008 database?

    sp_MSforeachdb @command1='use [?];

    SELECT DB_NAME() as DatabaseName,

    --s1.sql_handle,

    (SELECT TOP 1 SUBSTRING(s2.text,statement_start_offset / 2+1 ,

    ( (CASE WHEN statement_end_offset = -1

    THEN (LEN(CONVERT(nvarchar(max),s2.text)) * 2)

    ELSE statement_end_offset END) - statement_start_offset)...

Viewing post 1 (of 2 total)