http://exchange.braintapper.com/listing/tag/login/atom2012-05-21T12:36:30.000-05:00Braintapper Exchange - Feed for tag: loginSteven Nghttp://exchange.braintapper.com/sql-server-updating-logins-after-a-detach-or-restore2010-03-24T11:26:34.000-05:002010-03-24T11:26:34.000-05:00Code Snippet: SQL Server: Updating Logins after a Detach or Restore<p>If you ever migrate a SQL Server database from one server to another, you'll find that the database IDs get messed up when you reattach the database.</p>
<p>Use the SQL below to migrate the database's legacy ids to the new server's ids:</p>
<pre class="prettyprint"><code>USE dbname
go
EXEC sp_change_users_login 'Update_One', 'oldid', 'newid'
</code></pre>
slantyyz