Search
 
SCRIPT & CODE EXAMPLE
 

SQL

sql last time database was accessed

SELECT d.name,
last_user_seek = MAX(last_user_seek),
last_user_scan = MAX(last_user_scan),
last_user_lookup = MAX(last_user_lookup),
last_user_update = MAX(last_user_update)
FROM sys.dm_db_index_usage_stats AS i
JOIN sys.databases AS d ON i.database_id=d.database_id
GROUP BY d.name
Comment

PREVIOUS NEXT
Code Example
Sql :: sql inserted 
Sql :: array of objects sql 
Sql :: sql server management studio reset cache 
Sql :: SQL Rename Column in a Table 
Sql :: convert dd/mm/yyyy to yyyy-mm-dd in sql server 
Sql :: if null put 0 sql 
Sql :: declare or use variable in snowflake 
Sql :: select only the month-day from date in PL-SQL 
Sql :: sql full outer join with where clause 
Sql :: sql where contains part of string 
Sql :: convert html to plain text in sql server 
Sql :: how to define a save method in ruby for sql databases 
Sql :: mssql procedure 
Sql :: how to get parent and child record in single query using sql 
Sql :: SQL COUNT() with GROUP BY 
Sql :: influxdb delete measurement based on date 
Sql :: postgresql delete all content 
Sql :: mysql show slave status 
Sql :: mysql into outfile with headers 
Sql :: union vs union all in sql 
Sql :: restore backup "text" postgresql command line 
Sql :: python get backup of sql 
Sql :: how to get column name in db from an sqlalchemy attribute model 
Sql :: how to use query in nosql 
Sql :: how to put is null in where in clause 
Sql :: how to create triggers in sql server 
Sql :: get only one row in mysql 
Sql :: changing name of column and datatype in sql 
Sql :: connect to mysql server mac terminal 
Sql :: how to rename column name in sql server using query 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =