|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Yesterday @ 9:17 AM
Points: 1,786,
Visits: 1,022
|
|
| Good Question. These type of questions will help all of us bursh up our knowledge every day. Thank you again!!!
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Monday, June 17, 2013 8:01 AM
Points: 989,
Visits: 1,795
|
|
I knew exactly what the problem was and could not find sp_change_users_login, so I read the answers to decide which tried to do the same thing and got it correct. To me the value of the question is to educate that the old way we did it is going away.
And as for making the SID identical, well, yeah, this would be the IDEAL way to do it but in the real world, you won't always be administering servers you yourself set up if you get my drift. Always need to know your options.
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Tuesday, February 12, 2013 1:09 PM
Points: 335,
Visits: 391
|
|
| Such a bummer to me that the sp_change_users_login option is going to be phased out without a "decent" alternative - consider the scenario that exists in my environment where there lots of sql server logins, and (esp. in dev), you don't document the passwords for them, which makes the ALTER USER solution difficult to pull off. Plus, using sp_change_users_login 'Report' lets you see specifically which users are orphaned before you dive into trying to fix them.
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 4:21 AM
Points: 6,724,
Visits: 5,797
|
|
I have to agree. I like being able to cursor through the proc, having all the orphaned users fixed automatically without any typing. I just open up my saved cursor, execute it, and everything gets fixed.
Brandie Tarvin, MCITP Database Administrator, MCDBA, MCSA
Webpage: http://www.BrandieTarvin.net LiveJournal Blog: http://brandietarvin.livejournal.com/ On LinkedIn!, Google+, and Twitter.
Freelance Writer: Shadowrun Latchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.
|
|
|
|
|
SSChasing Mays
      
Group: General Forum Members
Last Login: Thursday, June 13, 2013 10:57 AM
Points: 659,
Visits: 465
|
|
| Nice question.. And thats exactly a perfect example before reading about Contained Databases in sql server "Denali".
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: Friday, June 14, 2013 2:30 AM
Points: 3,063,
Visits: 1,335
|
|
getoffmyfoot (2/7/2011) Such a bummer to me that the sp_change_users_login option is going to be phased out without a "decent" alternative - consider the scenario that exists in my environment where there lots of sql server logins, and (esp. in dev), you don't document the passwords for them, which makes the ALTER USER solution difficult to pull off. Plus, using sp_change_users_login 'Report' lets you see specifically which users are orphaned before you dive into trying to fix them.
You don't need the password of the login in order to use ALTER USER. But I agree the report option is pretty handy. Without that you'd need to run the actual SQL statement that sp_change_users_login uses:
select UserName = name, UserSID = sid from sysusers where issqluser = 1 and (sid is not null and sid <> 0x0) and (len(sid) <= 16) and suser_sname(sid) is null order by name
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Tuesday, June 11, 2013 5:24 AM
Points: 1,028,
Visits: 759
|
|
Ah, not the missing option of 'wtf are you using sql logins in production for anyway?'
What with them being inherently, disgracefully insecure.
For anyone that hasn't I strongly recommend using your favourite packet sniffer (wireshark for instance) to trace the local network while you log in with a sql login. Filter it for login packets... and watch in wonder as your password flies across the network in plain text! <_<
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Monday, June 17, 2013 8:01 AM
Points: 989,
Visits: 1,795
|
|
RichB (2/7/2011) Ah, not the missing option of 'wtf are you using sql logins in production for anyway?'
What with them being inherently, disgracefully insecure.
For anyone that hasn't I strongly recommend using your favourite packet sniffer (wireshark for instance) to trace the local network while you log in with a sql login. Filter it for login packets... and watch in wonder as your password flies across the network in plain text! <_<
As long as we have vendor apps, or we have people connecting from non-Windows sources, they will be a necessary evil....
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Thursday, January 31, 2013 8:01 AM
Points: 1,232,
Visits: 1,046
|
|
Nice question even if it was long winded. IMHO: Two points is a lot for a question that should be asked and answered correctly at any DBA interview.
This was the first DBA incident I ever had to resolve professionaly. I even got a contract once because the DR plan for a fortune 500 company did not include fixing SQL logins once databases had been restored from Tape to a new server on new hardware in a new domain. FUN!
|
|
|
|
|
Mr or Mrs. 500
      
Group: General Forum Members
Last Login: 2 days ago @ 3:05 PM
Points: 575,
Visits: 368
|
|
Ronald H (2/7/2011) Exactly a scenario that happens in our environments. Thanks for the question! Ditto x 2 .
Re the question's phrasing and its choices: since its "you" can successfully connect to Dev using "MyUser", wouldn't the two choices which submit a <NewPassword> make no sense? I answered the question correctly, but I'm just wondering if the right answer could be chosen merely based on that type of analysis of the question. Thanks.
|
|
|
|