SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Connection Problems


Connection Problems

Author
Message
Abi Chapagai
Abi Chapagai
SSCommitted
SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)

Group: General Forum Members
Points: 1922 Visits: 1127
Good Question. These type of questions will help all of us bursh up our knowledge every day. Thank you again!!!
jeff.mason
jeff.mason
SSCrazy
SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)

Group: General Forum Members
Points: 2631 Visits: 2137
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.
getoffmyfoot
getoffmyfoot
Right there with Babe
Right there with Babe (780 reputation)Right there with Babe (780 reputation)Right there with Babe (780 reputation)Right there with Babe (780 reputation)Right there with Babe (780 reputation)Right there with Babe (780 reputation)Right there with Babe (780 reputation)Right there with Babe (780 reputation)

Group: General Forum Members
Points: 780 Visits: 412
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.
Brandie Tarvin
Brandie Tarvin
SSC-Dedicated
SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)

Group: General Forum Members
Points: 36471 Visits: 9268
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 AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.
Surii
Surii
SSC Eights!
SSC Eights! (807 reputation)SSC Eights! (807 reputation)SSC Eights! (807 reputation)SSC Eights! (807 reputation)SSC Eights! (807 reputation)SSC Eights! (807 reputation)SSC Eights! (807 reputation)SSC Eights! (807 reputation)

Group: General Forum Members
Points: 807 Visits: 489
Nice question.. And thats exactly a perfect example before reading about Contained Databases in sql server "Denali".
Duncan Pryde
Duncan Pryde
SSCarpal Tunnel
SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)

Group: General Forum Members
Points: 4138 Visits: 1552
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


RichB
RichB
SSCrazy
SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)

Group: General Forum Members
Points: 2936 Visits: 1065
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! <_<



jeff.mason
jeff.mason
SSCrazy
SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)

Group: General Forum Members
Points: 2631 Visits: 2137
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....
SanDroid
SanDroid
SSCrazy
SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)

Group: General Forum Members
Points: 2368 Visits: 1046
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!Cool
Michael Poppers
Michael Poppers
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1109 Visits: 416
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.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search