sql-server: how do i know who is in my database?

后端 未结 4 556
后悔当初
后悔当初 2021-01-05 23:04

i have an access front end and sql server backend. i would like to know which users are currently using the database. is this possible to do using access or sql-server?

4条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-05 23:50

    1) You, the developer, must have VIEW SERVER STATE permissions on the SQL Server to see all executing sessions on the instance of SQL Server. Otherwise, you will see only your current session The easiest way would be to open a connection (i.e. using sqlcmd or Management Studio) using your sysadmin credentials and issue the following statement:

    GRANT VIEW SERVER STATE TO (your network userid)

    2) Access appears to disconnect from SQL Server after five or ten minutes of inactivity. I haven't yet had the time to do a detailed search and figure out what setting, if any, can overrride this.

    3) Developers who are using SQL Server tools may be connected to the master database even though they are looking at objects in the data database.

提交回复
热议问题