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.
Author |
Topic |
duanecwilson
Constraint Violating Yak Guru
273 Posts |
Posted - 2010-09-14 : 17:24:54
|
I have seen some ways to tell what user you are on a database, and I have also seen some ways to show what you logged in as - your active directory account name. But when I am logged in, even though I can show my domain login information (MyDomain\MyAccount), I cannot figure out how to:1) Show the AD group account that actually logged in, AND2) What login I used when looking at the SQL Server logins. When I try to show that, I just get my personal domain\login.I actually think I know which one I am using, because I see the SA SQL Server login account, which I know I am not using, and another one which when I look at the logins, is a Windows group account. But if there are more than one Windows group account login, I can't tell which one I have used. I have tried these following queries, NONE of which shows the Login in the security section of the server object browser:SELECT SUSER_ID() SUSER_IDSELECT SUSER_NAME() SUSER_NAMESELECT SUSER_SID() SUSER_SIDSELECT SUSER_SNAME() SUSER_SNAMESELECT USER [USER]SELECT USER_ID() USER_IDSELECT USER_NAME() USER_NAMESELECT USER_SID() USER_SIDSELECT CURRENT_USER [CURRENT_USER]SELECT @@CONNECTIONS CONNECTIONSSELECT DEFAULT_DOMAIN() DEFAULT_DOMAINSELECT HOST_ID() HOST_IDSELECT HOST_NAME() HOST_NAMESELECT ORIGINAL_LOGIN() ORIGINAL_LOGINSELECT PUBLISHINGSERVERNAME() PUBLISHINGSERVERNAMESELECT SCHEMA_ID() SCHEMA_IDSELECT SCHEMA_NAME() SCHEMA_NAMESELECT SESSION_USER [SESSION_USER]SELECT SYSTEM_USER [SYSTEM_USER] This should be basic information, and if I am going to create and administer a database, I should at least be able to view my own login info. I know many of these queries are unrelated, but I wanted to show what I have looked at. If anything, they give me my personal domain\account, but not the true login as I can script from SSMS.Duane |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
duanecwilson
Constraint Violating Yak Guru
273 Posts |
Posted - 2010-09-14 : 18:15:40
|
Thank you again for your response. I have sysadmin on a couple of them, not nearly all. So, I am tried it on the ones I do, and that answered my question. I wish there was a way on the others at least to view my own, but it is not really that important. I was just trying to understand how things work.Duane |
 |
|
|
|
|
|
|