Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 find last processed message

Author  Topic 

Ambika
Starting Member

4 Posts

Posted - 2011-07-18 : 08:30:37
SELECT spid,'Status' = CONVERT ( CHAR(10), status ),
'login' = CONVERT ( CHAR (15), loginame),
'NT Account' = CONVERT ( CHAR (12), nt_username),
'Workstation Id' = CONVERT ( CHAR (15), hostname),
blk = CONVERT ( CHAR (5), blocked),
dbname = CONVERT ( CHAR (20), db_name(dbid) ),
'Program' = CONVERT ( CHAR (10), program_name),
'Command' = CONVERT ( CHAR (20), cmd )
FROM
master.dbo.sysprocesses
WHERE
spid BETWEEN 0 and 32767 AND
dbid = db_id('interface')
ORDER BY
loginame,
hostname,
spid

Ambik

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2011-07-18 : 08:32:31
what is the question?


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

Ambika
Starting Member

4 Posts

Posted - 2011-07-18 : 08:46:59
query to find size of both mdf and ldf size of all databases

SELECT DB_NAME( DBID ) AS DBName,
CONVERT( DECIMAL( 10, 2 ), CONVERT( DECIMAL(10,2), size ) * 8 / 1024 ) AS SizeMB,
fileName
FROM master.dbo.sysaltfiles
Go to Top of Page
   

- Advertisement -