Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 NTUserName not appearing in SQL Profiler

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-05-01 : 08:39:31
gary writes "I have a few machines on my network that I cannot get to provide the NTUserName for the profiler. This is a little annoying when trying to trace problems.

My machine provides the NTUserName fine, as do about 85% of the machines connected to the database server. We're running Win2K and SQL2000.

Here's an odd thing also - one of the users who's NTUserName does not appear in the profiler - I set him as a user on my machine. He then logged in on my machine using his login name and password and then when he accessed the database his NTUserName showed up properly in the Profiler. He logged out, went back to his machine and logged back in and it didn't show up. The opposite is also true. He granted me access to his machine and I logged in. My NTUserName didn't show up when connected on his machine, but I logged out, came back to my machine and logged back in and my NTUserName began showing up again.

Thank you for any assistance you can provide."

efelito
Constraint Violating Yak Guru

478 Posts

Posted - 2002-05-01 : 11:18:17
I would start by looking at the differences between your to machines. Try checking things like MDAC versions, OS versions and patch levels, and tool/application versions.

Jeff Banschbach
Consultant, MCDBA
Go to Top of Page

garygr
Starting Member

5 Posts

Posted - 2002-05-01 : 12:11:16
Jeff,

Thanks for the reply. Versions seem to be identical across machines:

MDAC: 2.6 RTM (2.60.6526.3)
OS : Win2000 5.00.2195 SP2
SQL : 8.00.194
Tool: SQL Query Analyzer

I neglected to mention that the NTUserName doesn't show up even when using teh Query Analyzer tool.


Go to Top of Page

MichaelP
Jedi Yak

2489 Posts

Posted - 2002-05-01 : 12:56:57
This is a wild guess, but what network protocals are installed for the PC in question?

My guess is that he's only using TCP/IP and not NetBEUI. That should not matter but who knows.

Michael

Go to Top of Page

MichaelP
Jedi Yak

2489 Posts

Posted - 2002-05-01 : 12:58:42
Another thing to check on the PC in question is the Client Netowkr utility. See what protocals are enabled.

Are you using SQL Authentication or Windows Authentication for your connections to SQL Server?

Michael

Go to Top of Page

garygr
Starting Member

5 Posts

Posted - 2002-05-01 : 13:31:00
On both machines:

Enabled protocols by order:
TCP/IP
Named Pipes

Connecting via SQL Server Authentication



Go to Top of Page

MichaelP
Jedi Yak

2489 Posts

Posted - 2002-05-01 : 13:38:28
What about the network protocals installed for the nic?

Michael

Go to Top of Page

garygr
Starting Member

5 Posts

Posted - 2002-05-01 : 15:13:26
TCP/IP only

Go to Top of Page

MichaelP
Jedi Yak

2489 Posts

Posted - 2002-05-01 : 15:22:07
The PC's that are sending the NTUserName, what protocals do they have installed for thier NIC's?

Go to Top of Page

garygr
Starting Member

5 Posts

Posted - 2002-05-01 : 16:05:42
All the same, TCP/IP only.

Go to Top of Page

MichaelP
Jedi Yak

2489 Posts

Posted - 2002-05-01 : 16:16:03
Welp I'm outta ideas, sorry man.

Can I ask what you need the NTUserName for? Maybe there's another more reliable way to solve your problem. Can you post the exact code that you are using?

Michael



Go to Top of Page

garygr
Starting Member

5 Posts

Posted - 2002-05-01 : 16:26:28
Thanks Michael,

I was trying to trace who was doing what against the database using the profiler and was using the NTUserName to determine who the user was. I realize I could use LoginName, but unfortunately in the app we're using everybody uses the same LoginName. Everybody's running the same application on what I think are identically configured machines, yet the NTUserName showed up for some and not others. So, I first spent some time looking at the application, thinking there was a problem with that. Then, I got the idea to see if loging into the SQL Query Analyzer and doing some stuff populated the NTUserName. It did not, so I'm currently thinking it's got to be some difference in the machine configuration and not the application we're using, but I'm absolutely stuck. It's not a hugely critical problem, just that I've been working on it on and off for a few days and it's one of those deals where I can't bring myself to give up! I appreciate your responses.



Go to Top of Page

MichaelP
Jedi Yak

2489 Posts

Posted - 2002-05-01 : 16:42:27
What about
select host_name()

Unless people float aroudn to different PC's that might work for ya.

Michael

Go to Top of Page
   

- Advertisement -