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 |
|
bgard6977
Starting Member
1 Post |
Posted - 2007-04-27 : 16:46:18
|
| Is there anyway to query for what users are associated with a given login? I am writing an web app that allows people to change the password for thier login, except that I don't want to let them change that password unless they are the only user associated with it.Currently I am generating a queries in a for/next loop, one for each DB on the server, then unioning them together. Except the server has several hundred DB's and the operation is timing out.It looks kind of like this:select 'Database1' as DbNamefrom master.db.syslogins linner join Database1.dbo.sysusers uon l.sid=u.sidwhere l.loginname='username'unionselect 'Database2' as DbNamefrom master.db.syslogins linner join Database2.dbo.sysusers uon l.sid=u.sidwhere l.loginname='username'Any help would be, well, helpful :-) |
|
|
|
|
|