x

Resolving orphaned users

With the announced deprecation of sp_change_users_login, how are we to use ALTER LOGIN to fix orphaned users, in the same way that I used to use

sp_change_users_login 'update_one','mary','mary'


Edit: Matt Whitfield pointed out I should have been talking about ALTER USER. My bad!

more ▼

asked Oct 12, 2009 at 01:54 PM in Default

avatar image

Kev Riley ♦♦
64k 48 61 81

(comments are locked)
10|1200 characters needed characters left

2 answers: sort voted first

You want to use ALTER USER, rather than ALTER LOGIN.

The equivalent would be

ALTER USER mary
WITH LOGIN = mary
more ▼

answered Oct 12, 2009 at 01:59 PM

avatar image

Matt Whitfield ♦♦
29.5k 62 66 88

(comments are locked)
10|1200 characters needed characters left

From BOL, in SQL Server 2008 you can use the WITH LOGIN option of ALTER USER in order to fix an orphaned user. This functionality is also available in 2005.

more ▼

answered Oct 12, 2009 at 02:02 PM

avatar image

Tim Benninghoff
43 1 1 5

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x2076
x1066
x5

asked: Oct 12, 2009 at 01:54 PM

Seen: 4970 times

Last Updated: Oct 15, 2009 at 05:57 AM

Copyright 2016 Redgate Software. Privacy Policy