How to get last updated Stored procedure in database:
Run following command.
SELECT name,modify_date
FROM sys.objects
WHERE type = 'P' order by modify_date desc
AND DATEDIFF(D,modify_date, GETDATE()) < 5
How to get open connection in SQL Server for each database.
SELECT
DB_NAME(dbid) as DBName,
COUNT(dbid) as
NumberOfConnections,
loginame as
LoginName
FROM
sys.sysprocesses
WHERE
dbid
> 0
GROUP BY
dbid, loginame
No comments:
Post a Comment