in

Dot Net Mafia

Group site for developer blogs dealing with (usually) .NET, SharePoint 2013, SharePoint 2010, Office 365, SharePoint Online, and other Microsoft products, as well as some discussion of general programming related concepts.

This Blog

Syndication

Archives

Corey Roth [MVP]

A SharePoint MVP bringing you the latest time saving tips for SharePoint 2013, SharePoint 2010, Office 365, SharePoint Online, MOSS 2007, ASP.NET, LINQ, and Visual Studio 2012.

How to map SQL Logins

If you have ever backed up a database and restored it to a new server, you may have encountered issues with the logins associated with the database. The issue is that all the logins are mapped to security contexts on the other server. It may not be apparent at first on how to fix this (nothing in the GUI that I have found), but there is a stored procedure you can run that makes it easy.

sp_change_users_login 'Update_One', 
'DatabaseUsername', 'SqlUsername'

This will map the username in the database named DatabaseUsername to the SQL Server login SqlUsername. Update_One is a parameter that tells it what type of update to do. You can also pass 'Auto_Fix' here and supply an additional password parameter to have it create the account for you.

Read the complete post at http://www.dotnettipoftheday.com/blog.aspx?id=320

2012 dotnetmafia.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems