Re: users with no logins

From: Brian Nall (not@innewsgroups.com)
Date: 05/30/02


From: "Brian Nall" <not@innewsgroups.com>
Date: Thu, 30 May 2002 08:28:33 -0500


Worked great... thanks for the help

--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Dan Guzman" <danguzman@nospam-earthlink.net> wrote in message
news:ue4tus9BCHA.1732@tkmsftngp02...
> 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
> >
> >
> >
>
>


Relevant Pages

  • Re: Simple SQL Security Question From SQL Newbie
    ... >exec sp_grantdbaccess 'WIN2K\ASPNET' ... >VS.NET, I can use the server explorer and I can see the database, it's ... >login 'WebCalendar'. ... I also did a GRANT ALL on y2003 TO ASPNET ...
    (microsoft.public.sqlserver.security)
  • Re: Import Logins from text or spreadsheet
    ... set psw to generic value ... add user to database ... EXEC sp_addrolemember 'SomeRole', 'SomeLogin' ... Let's assume your Excel spreadsheet has 3 columns: Login, ...
    (microsoft.public.sqlserver.server)
  • Re: Import Logins from text or spreadsheet
    ... Good suggestion, Steve. ... EXEC sp_addlogin $, $, $(Database) ... EXEC sp_addrolemember $, $(Login) ...
    (microsoft.public.sqlserver.server)
  • Re: users with no logins
    ... User login mapping can get out-of-sync following a restore. ... an error stating 'the proposed owner is already a user in the database' ... EXEC sp_changedbowner 'TempLogin' ... the dbo user name shows "sa" as the login. ...
    (microsoft.public.sqlserver.security)
  • Re: PDO: Switch database user without reopening connection
    ... At the bare minimum there will be a login user who only has ... modifications to the database as well (editors get update permission, ... As database connections are expensive to ... a certain visitor in the Session, and use that value to start the right ...
    (comp.lang.php)