RE: Creating a DB User *not* on current Machine



Hello Alex,

From your description, I understand that you'd like to create a DB user to
exist in your database matched to a not existing Windows login before you
detach/attach the database to a new server.

I'm afraid this option is not available due to the behavior of SQL
Server.When you move a database from one server that is running SQL Server
to another server that is running SQL Server, a mismatch may occur between
the security identification numbers (SIDs) of the logins in the master
database and the users in the user database.

By default, SQL Server 7.0, SQL Server 2000, and SQL Server 2005 provide
the sp_change_users_login system stored procedure to map these mismatched
users. However, you can only use the sp_change_users_login stored procedure
to map standard SQL Server logins and you must perform these mapping for
one user at a time.

In SQL Server 7.0 or later versions, you can maintain the mapping between
the logins in the master database and the users in the user database by
using the SIDs. This mapping is required to maintain correct permissions
for the logins in the user databases. When a login on the new server does
not have matched SID of one of the user on the database moved, you have to
create a new database base user to map them. Also, it's not possible to
create a local user on a different machine.


The best option is that you use a domain user so that the login exist on
the both SQL Servers. After you move the database, the SID is matched
automatically and you don't need to re-create the DB user for the login.

You may want to see the following article for more details:


314546 HOW TO: Move Databases Between Computers That Are Running SQL Server
http://support.microsoft.com/?id=314546

240872 HOW TO: Resolve Permission Issues When You Move a Database Between
http://support.microsoft.com/?id=240872

HOW TO: Transfer Logins and Passwords Between Instances of SQL Server
http://support.microsoft.com/kb/246133

If anything is unclear or you have further comments, please feel free to
post back. Thank you.

Best Regards,

Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications
<http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx>.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
<http://msdn.microsoft.com/subscriptions/support/default.aspx>.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

.



Relevant Pages

  • RE: WSS install locked into MSDE DB - Can not install for SQL Serv
    ... For the MASTER database ... Althought we change the Configuration Application pool several times ... interface BUT they appear to be MSDE databases and not SQL Server databases. ...
    (microsoft.public.sharepoint.windowsservices)
  • Re: How to Replicate an SQL Server 2000 Database
    ... actual server name) enterprise manager should associate the database with the ... Looking for a SQL Server replication book? ...
    (microsoft.public.sqlserver.replication)
  • Re: SQL 2005 Best Practice vs SQL 2000: Application Files Separate from data (and log) files
    ... I have had quite a number of clients that used a SAN for a database server and suffered significant performance problems because their underlying SAN infrastructure was a huge stripe across many drives. ... By application files I mean the binn folder which contains the sql server executable among other things. ...
    (microsoft.public.sqlserver.setup)
  • RE: SBS 2003 Unable to connect to database STS_Config
    ... Check the database connection information and make sure that the database ... Uninstall SQL Server; ... Reinstall Monitoring and Sharepoint and make sure they work; ...
    (microsoft.public.windows.server.sbs)
  • RE: Need help with copy database
    ... in the event log for the server SQL was running on. ... This was a username from the database ... SQL Server Agent service is run with a domain account that has full admin ... if @backupSetId is null begin raiserror(N''Verify failed. ...
    (microsoft.public.sqlserver.dts)