Browse by Tags

Display the server-level information the application role can currently view.
09 August 07 03:28 AM | SQL Master | 2 Comments   
SELECT sid, status, name, dbname, hasaccess, loginname FROM master.dbo.syslogins; GO SELECT spid, kpid, lastwaittype, waitresource, dbid FROM master.dbo.sysprocesses; GO Read More...
Retrieve SessionID and batch information
24 July 07 02:37 AM | SQL Master | 1 Comments   
You may be aware using SP_WHO or SP_WHO2 statements you can get information about a session id and statement that is running since good olden days of SQL Server. Within SQL 2005 version you can take help of TSQL: SELECT session_id, text FROM sys.dm_exec_requests Read More...
TSQL to return (display) all tables row count in database - think about performance
16 July 07 02:05 AM | SQL Master | 1 Comments   
In the forums and newsgroups this is a very common question that how to get all the tables rowcount or to get optimum values. You may be aware using SELECT COUNT(*) statement, but be aware it will make full table scan to return the rowcount and think Read More...