Re: users with no logins
From: Dan Guzman (danguzman@nospam-earthlink.net)
Date: 05/30/02
- Next message: Brian Nall: "Re: users with no logins"
- Previous message: Herbert: "Re: Using SQL username as criteria on a view"
- In reply to: Brian Nall: "users with no logins"
- Next in thread: Brian Nall: "Re: users with no logins"
- Reply: Brian Nall: "Re: users with no logins"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: "Dan Guzman" <danguzman@nospam-earthlink.net> Date: Thu, 30 May 2002 08:09:49 -0500
User login mapping can get out-of-sync following a restore. You can
correct the dbo user with sp_changedbowner. In some cases you may get
an error stating 'the proposed owner is already a user in the database'
and the script below will work around that problem.
USE MyDatabase
EXEC sp_addlogin 'TempLogin'
EXEC sp_changedbowner 'TempLogin'
EXEC sp_changedbowner 'sa'
EXEC sp_droplogin 'TempLogin'
For non-dbo users, use sp_change_users_login. See the Books Online for
details.
Hope this helps.
Dan Guzman
SQL Server MVP
-----------------------
SQL FAQ links (courtesy Neil Pike):
http://www.ntfaq.com/Articles/Index.cfm?DepartmentID=800
http://www.sqlserverfaq.com
http://www.mssqlserver.com/faq
-----------------------
"Brian Nall" <not@innewsgroups.com> wrote in message
news:#6oVoSyBCHA.1588@tkmsftngp02...
> Is there a reason for database user names to not show a login name
when you
> view the users in a database? I have noticed that in just about all
of my
> databases, the dbo user name shows "sa" as the login. But I have
found that
> one of my databases that show the dbo user name with no login
associated
> with it.
>
> Any ideas,
>
> Thanks in advance for any help.
>
> Brian Nall
>
>
>
- Next message: Brian Nall: "Re: users with no logins"
- Previous message: Herbert: "Re: Using SQL username as criteria on a view"
- In reply to: Brian Nall: "users with no logins"
- Next in thread: Brian Nall: "Re: users with no logins"
- Reply: Brian Nall: "Re: users with no logins"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|