Incorrect Logon-type showed in the Session table?

pdj
Member Posts: 643
NAV5SP1 with update 1, SQL2005SP2 with update 8
I have a single pc which always seems to login to our database using Windows Authentication. No matter if the user logs in using Windows or Database Authentication. We have tried to restart Windows. Then we tried re-installing NAV. Nothing helped. Other sessions are shown correctly, but this single pc is “sick” in some way. We have some code that acts differently based on the logontype, so we require this field to be correct. I know the session table is simply a SQL view, but how do I troubleshoot the problem?
I have a single pc which always seems to login to our database using Windows Authentication. No matter if the user logs in using Windows or Database Authentication. We have tried to restart Windows. Then we tried re-installing NAV. Nothing helped. Other sessions are shown correctly, but this single pc is “sick” in some way. We have some code that acts differently based on the logontype, so we require this field to be correct. I know the session table is simply a SQL view, but how do I troubleshoot the problem?
Regards
Peter
Peter
0
Answers
-
Any parameter passed to the client from the used shortcut? Did you tried to run the fin.exe/finsql.exe directly?0
-
We have tried with "clean" zup-file and forcing NTAuthentication in the parameters but no change. ](*,)
Then someone discovered that the Net Type was different! ( \:D/ \:D/ Thank you Morten \:D/ \:D/)
It turns out that it changed default Net Type from TCP to NamedPipes once the windows user was upgraded to SQLAdmin. So by forcing it to use TCP it works like a dream...Regards
Peter0 -
The real problem lies in how the session view resolves if it is windows user. It does by checking if the ntdomain field is filled in the view. This is incorrect. If you connect to the database using a trusted connection it will fill the ntdomain field evn if you login using a database login. This can be solved by changing the session view. If you run the following script from the query analyzer it will work correctly. This code works for SQL2000 and SQL2005.
USE [DATABASE_NAME] GO /****** Object: View [dbo].[Session] Script Date: 11/06/2008 13:16:43 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER VIEW [dbo].[Session] AS SELECT CAST(SP.[spid] AS INTEGER) AS "Connection ID", CAST(RTRIM(SP.[loginame]) AS NVARCHAR(64)) COLLATE Latin1_General_CS_AS AS "User ID", CAST(CASE WHEN SP.[spid] = @@SPID THEN 1 ELSE 0 END AS TINYINT) AS "My Session", CONVERT(DATETIME, '1754-01-01 '+CONVERT(CHAR(8), SP.[login_time], 108), 120) AS "Login Time", CONVERT(DATETIME, CONVERT(CHAR(10), SP.[login_time], 120)+' 00:00:00:000', 121) AS "Login Date", CAST (SD.[name] AS NVARCHAR(128)) COLLATE Latin1_General_CS_AS AS "Database Name", CAST (RTRIM(SP.[program_name]) AS NVARCHAR(64)) COLLATE Latin1_General_CS_AS AS "Application Name", SL.[isntuser] AS "Login Type", CAST(RTRIM(SP.[hostname]) AS NVARCHAR(64)) COLLATE Latin1_General_CS_AS AS "Host Name", SP.[cpu] AS "CPU Time (ms)",CASE WHEN SP.[memusage] < 0 THEN 0 ELSE SP.[memusage]*8 END AS "Memory Usage (KB)",SP.[physical_io] AS "Physical I_O", CAST(CASE WHEN SP.[blocked] <> 0 THEN 1 ELSE 0 END AS TINYINT) AS "Blocked", CAST(CASE WHEN SP.[blocked] <> 0 THEN SP.[waittime] ELSE 0 END AS INTEGER) AS "Wait Time (ms)", CAST(SP.[blocked] AS INTEGER) AS "Blocking Connection ID", CAST(ISNULL(RTRIM(SPB.[loginame]), '') AS NVARCHAR(64)) COLLATE Latin1_General_CS_AS AS "Blocking User ID", CAST(ISNULL(RTRIM(SPB.[hostname]), '') AS NVARCHAR(64)) COLLATE Latin1_General_CS_AS AS "Blocking Host Name", CAST('' AS NVARCHAR(64)) COLLATE Latin1_General_CS_AS AS "Blocking Object", CASE WHEN SP.[cmd] = 'AWAITING COMMAND' THEN CAST(DATEDIFF(SECOND, SP.[last_batch], GETDATE()) AS BIGINT)*1000 ELSE 0 END AS "Idle Time" FROM [master].[dbo].[sysprocesses] AS SP JOIN [master].[dbo].[sysdatabases] AS SD ON (SP.[dbid] = SD.[dbid]) LEFT OUTER JOIN [master].[dbo].[sysprocesses] AS SPB ON (SP.[blocked] = SPB.[spid]) LEFT JOIN [master].[dbo].[syslogins] AS SL ON (SP.[sid] = SL.[sid]) WHERE SP.[ecid] = 0 AND SP.[last_batch] >= CONVERT(DATETIME, '2000-01-01 00:00:00', 120)
Hope this will help0 -
Thanks a lot. Have you reported this to Microsoft or should I do it?Regards
Peter0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions