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 |
dolphin123
Yak Posting Veteran
84 Posts |
Posted - 2012-07-17 : 16:15:27
|
Hi,I wrote this query to find the users who created the databases on an instance, but I am getting the wrong user IDs such as dbo.I like to know the user as in "Security - logins". How can I find that out?SELECT sd.sid,sd.name,sd.crdate, su.nameFROM master..sysdatabases sdinner join master..sysusers su on sd.sid = su.sidAlso, if a user logged in using the windows security (that is "domainname\username", is there any way to list that one?Appreciated in advance. |
|
lionofdezert
Aged Yak Warrior
885 Posts |
Posted - 2012-07-18 : 05:16:20
|
SELECT sd.name,sd.create_date, su.nameFROM sys.databases sdleft outer join master..syslogins su on sd.owner_sid = su.sid--------------------------http://connectsql.blogspot.com/ |
|
|
dolphin123
Yak Posting Veteran
84 Posts |
Posted - 2012-07-18 : 13:10:17
|
Thanks a lot |
|
|
|
|
|