Re: create new login
- From: "Uri Dimant" <urid@xxxxxxxxxxx>
- Date: Wed, 29 Aug 2007 10:48:39 +0300
Erland
In SQL 2005 SP2, it's also possible to use one of ALTER >USER and ALTER
LOGIN (I don't remember which) to change the SID, but >unfortunately,
this is not in Books Online.
You are correct
ALTER USER username WITH login = loginame;
"Erland Sommarskog" <esquel@xxxxxxxxxxxxx> wrote in message
news:Xns999AF27A4FBB3Yazorman@xxxxxxxxxxxx
Mike (Mike@xxxxxxxxxxxxxxxxxxxx) writes:
I migrated a SQL 2005 db from our development server to our QA server. I
created a new ID for the application to use on the QA SQL server. The
problem I'm facing is, I can't connect using the ID I created or even
the ID that was already in the db on the test server. I did a backup of
the DB on the test server, did a restore on the QA server and the ID's
will not connect. I keep getting 'login failed for username'
The username is under the security tab of SQL, and I have it pointing to
the DB that it will be connected to, but no success.
Any ideas on what could be causing this to fail?
Mapping between server logins and database users is by SID, not by
name. It's perfectly possible for the login Nisse to map to a user
Kalle in a database. Since SIDs are different on different server, you
typically get this problem when you move a database from one server
to another.
You can use sp_change_users_login to fix this.
Another way is to drop the login you created, and then recreate it
with CREATE LOGIN WITH SID =, where you get SID from
sys.database_principals for the database in question.
In SQL 2005 SP2, it's also possible to use one of ALTER USER and ALTER
LOGIN (I don't remember which) to change the SID, but unfortunately,
this is not in Books Online.
--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.
- Follow-Ups:
- Re: create new login
- From: Erland Sommarskog
- Re: create new login
- References:
- create new login
- From: Mike
- Re: create new login
- From: Erland Sommarskog
- create new login
- Prev by Date: Re: Execute permissions Stored Procedures
- Next by Date: Re: SQL 2005 Password Changes
- Previous by thread: Re: create new login
- Next by thread: Re: create new login
- Index(es):
Relevant Pages
|