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
 SQL users logged in report

Author  Topic 

kid_on_the_block
Posting Yak Master

172 Posts

Posted - 2006-02-15 : 02:08:52
Hi

I need to get a report that tells me the no. of users logged on to the SQL Server (this has to be an hourly report)

Will this do



WHILE 1=1
BEGIN
Select Hostname,getdate() from sysprocesses
WAITFOR DELAY '00:59:00'
END
GO


Will it have any bad affects on the SQL Server


Or can someone plz let me knw how to get that


Thanks

activecrypt
Posting Yak Master

165 Posts

Posted - 2006-02-15 : 03:10:54
Hi,
why don't you maintain separate table to record the same details ?! it would be easy and less hassels to you.



Andy Davis
Sql Shield Team
--------------------------------------------
SQL Server Encryption Software
http://www.sql-shield.com
Go to Top of Page

kid_on_the_block
Posting Yak Master

172 Posts

Posted - 2006-02-15 : 04:33:13
ok , but then all i need to do is an insert right , the entire delay would be right ????
Go to Top of Page

activecrypt
Posting Yak Master

165 Posts

Posted - 2006-02-18 : 06:30:10
i didn't understand it ! is your application already runnning ! its always chance to imporvement. If you have that records from earlier stage you can insert it from the files.


Regards

Andy Davis
Sql Shield Team
--------------------------------------------
SQL Server Encryption Software
http://www.sql-shield.com
Go to Top of Page
   

- Advertisement -