Login
`
Templates, Tools and Utilities
|
||
Add a comment to an Icetips ArticlePlease add your comments to this article.
Please note that you must provide both a name and a valid email address in order
for us to publish your comment. Comments are moderated and are not visible until they have been approved. Spam is never approved!
Back to article list Search Articles Add Comment Printer friendly Direct link Par2: Who's logged on -- SQL 2009-03-12 -- J Shankar >Does anyone know how I can read the MS SQL sp_hook to determine in a station
>is logged on. This is my thinking, I would like to write a function that can
>allow a user to logon only once to the database.
I use a query shown below to find out all users logged into a database ::
SELECT master.dbo.sysprocesses.nt_username AS NetworkUserName,
master.dbo.sysprocesses.loginame AS LoginName,
convert(char(20),master.dbo.sysprocesses.login_time,113) AS LoginTime,
master.dbo.sysdatabases.name AS DatabaseName,
master.dbo.sysprocesses.hostname AS ComputerName,
master.dbo.sysprocesses.net_address AS MACAddress,
master.dbo.sysprocesses.program_name AS ProgramName
FROM master.dbo.sysprocesses, master.dbo.sysdatabases
WHERE master.dbo.sysdatabases.dbid = master.dbo.sysprocesses.dbid
AND master.dbo.sysdatabases.name = '
Today is November 21, 2024, 6:54 am This article has been viewed 35236 times.
|
|