Hello to all,
From where I can find who are login in accessing the SQL Server 2012 database and how to kill the session?
Best wishes
*This post is locked for comments
Hello to all,
From where I can find who are login in accessing the SQL Server 2012 database and how to kill the session?
Best wishes
*This post is locked for comments
Hello,
IF you execute Tharanga SQL Query, the Field Login (3'rd Field) in Result Windows provides you the Windows Login ID of the User.
That is the User who is accessing the Navision.
** For Any Client Running RTC the Output will not be correct, For Role Tailored Client The Query will show you the User as the User who is Set to Run the Services for Navision.
Hello Tharanga,
It work but need to specify me which user is this?
best regards,
to get the users of your nav database write
SELECT [User Name] FROM [<your db>].[dbo].[User]
Please do start new threads for your new questions and please do verify the answers.
Use below query :
DECLARE @Table TABLE( SPID INT, Status VARCHAR(MAX), LOGIN VARCHAR(MAX), HostName VARCHAR(MAX), BlkBy VARCHAR(MAX), DBName VARCHAR(MAX), Command VARCHAR(MAX), CPUTime INT, DiskIO INT, LastBatch VARCHAR(MAX), ProgramName VARCHAR(MAX), SPID_1 INT, REQUESTID INT ) INSERT INTO @Table EXEC sp_who2 SELECT * FROM @Table WHERE DBName = 'YourNAVDBName'
You can get all the information about current users, sessions, and processes in an instance of the Microsoft SQL Server Database Engine from 'sp_who2' stored procedure.
Read more about sp_who2
How to find users who using Microsoft Dynamic NAV database?
IF you are looking for all Logins in SQL SErver then run below command -
SELECT * FROM sys.server_principals
You want list of active users or all the users in sql.
The Above results show you active users in SQL with database name that they are using.
HI,
I need the list of users it give me following details.
regards,
Try this -
It list all users connected to database -
SELECT
DB_NAME(dbid) as DBName,
COUNT(dbid) as NumberOfConnections,
loginame as LoginName
FROM
sys.sysprocesses
WHERE
dbid > 0
GROUP BY
dbid, loginame
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,269 Super User 2024 Season 2
Martin Dráb 230,198 Most Valuable Professional
nmaenpaa 101,156