http://exchange.braintapper.com/listing/tag/login/atom 2012-05-21T12:36:30.000-05:00 Braintapper Exchange - Feed for tag: login Steven Ng http://exchange.braintapper.com/sql-server-updating-logins-after-a-detach-or-restore 2010-03-24T11:26:34.000-05:00 2010-03-24T11:26:34.000-05:00 Code 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