首页 > 数据库 > SQL Server > 查看用户连接到特定数据库
|
use master; go select * from sysprocesses where dbid in (select dbid from sysdatabases where name='数据库名称'); or --使用db_id 函数 select * from sysprocesses where dbid=db_id('isa_test') |
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/30182853/viewspace-2132186/ ,如需转载,请注明出处,否则将追究法律责任。