vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Dear Group I wondered whether there's a function or script that will show me whether a user is currently logged-on to a MSSQL 2000 database? I'm using SQL Authentication. Thanks very much for your help & efforts! Have a nice day! Martin |
| |||
| You can use sp_who or sp_who2, or if you need something from code then a statement like this will work: if exists (select * from master.dbo.sysprocesses where loginame = 'MyLogin' and dbid = db_id('MyDB')) begin /* Do something here */ end Simon |