I've been slightly perplexed at the results of the following query depending on where I'm running it from:
SELECT spid, nt_username
FROM sys.sysprocesses
where spid=@@spid
(I realize I can run SUSER_Name() as well as a variety of other username functions, this is just an example)
Anyway, I have 2 different modules for an application. Both of them run on the same database, just out of different ports on the server. They run from SQL Server 2005. Both modules have their own built-in query executors (limited functionality; select statements only).
The thing that confuses me is that if I run the aforementioned query, one module always returns the nt_username value=the local machine username
while the other module returns tthe nt_username=the admin security group in SQL Server.
So for example, the results from module 1 of the above query might be:
SPID nt_username
55 FLAM
while the results of module 2 might be:
SPID nt_username
62 T_Admin
I'm not sure if this is something on the application or something I can change in SQL Server.
Anyone have any ideas?
Thanks much!



LinkBack URL
About LinkBacks
Reply With Quote
You can always PM me! 
Bookmarks