Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old February 16th, 2006, 09:17 PM
Authorized User
Join Date: Jun 2003
Posts: 62
Thanks: 0
Thanked 0 Times in 0 Posts
Default Checking user list logon to SQL server

how am i going to list out to those using sql server, so far i only know how many user logon but i dunno who logon the SQL server.
Old February 16th, 2006, 10:01 PM
SQLScott's Avatar
Wrox Author
Join Date: Dec 2004
Posts: 338
Thanks: 0
Thanked 2 Times in 2 Posts

try using the sp_who system stored proc. it is used as follows:

EXEC sp_who

This will tell you who is logged on, and to what database, adn from what computer.

Old February 19th, 2006, 06:42 PM
Friend of Wrox
Join Date: Dec 2005
Posts: 146
Thanks: 0
Thanked 1 Time in 1 Post

sp_who2 is also revealing: it shows almost all the same columns but adds CPUTime, DiskIO, LastBatch, and Program Name.

David Lundell
Principal Consultant and Trainer
Old May 15th, 2006, 07:40 PM
Authorized User
Join Date: Jun 2003
Posts: 62
Thanks: 0
Thanked 0 Times in 0 Posts

i need to know which pc connected to my SQL server.
Old May 16th, 2006, 02:35 AM
Authorized User
Join Date: Mar 2006
Posts: 80
Thanks: 0
Thanked 0 Times in 0 Posts

SELECT loginame, hostname, db_name(dbid) FROM master.dbo.sysprocesses


Similar Threads
Thread Thread Starter Forum Replies Last Post
One user getting logon screen digby_dog Access 4 August 6th, 2007 12:44 PM
Logon failure: user account restriction. Possible zaghmout HTML Code Clinic 2 January 6th, 2007 10:34 AM
Checking null values in Query(SQL Server) Prob leo_vinay Classic ASP Databases 2 December 28th, 2004 04:31 AM
Obtaining User Logon dearnne Access 1 September 2nd, 2004 01:39 PM
How to detect if a user is logon a Windows NT øej Pro VB.NET 2002/2003 1 January 23rd, 2004 10:30 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.