Re: select from one db only

From: Kalen Delaney (replies_at_public_newsgroups.com)
Date: 08/12/03


Date: Mon, 11 Aug 2003 16:40:42 -0700


Those databases are available to anyone who can login to the server because
there is a 'guest' user defined. You should never remove guest from master
or tempdb, but you can remove guest from pubs and northwind if you really
don't want a user to have access. But why not, you might ask, those
databases are just for 'trying things out'.

use pubs
exec sp_dropuser guest
use northwind
exec sp_dropuser guest.

--
HTH
----------------
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Dinesh.T.K" <tkdinesh@nospam.mail.tkdinesh.com> wrote in message
news:#V12M3FYDHA.2648@TK2MSFTNGP09.phx.gbl...
> Doug,
>
> >>>Is there a way
> > that I can make it so he can only see the
> > one db and not the others?
>
> No.He can see those system databases and sample databases because its
common
> knowledge that in a default SQL Server installation these are bound to be
> there.You can however restrict "seeing" other user databases.However, this
> privilege is available only via Query Analyzer while Enterprise manager
> displays all user databases.The user will be belonging to the public, by
> default and thats why he can SELECT from the various tables in
system/sample
> databases.You can however DENY permissions.For example, to deny the user
> 'test' from doing any operation on master..sysobjects, you log in as
> sysadmin and do:
>
> USE master
> GO
> DENY ALL ON sysobjects TO test
>
> More details on the BooksOnLine topic 'DENY'
>
>
> --
> Dinesh.
> SQL Server FAQ at
> http://www.tkdinesh.com
>
> "Doug" <dag@its.msstate.edu> wrote in message
> news:0b9301c36053$03a01240$a001280a@phx.gbl...
> > Newbie question???
> >
> > I created a login for a user.
> > His default db is the only db that
> > I want him to see. He does not have
> > any server roles and database access
> > only to the one db. When this user
> > runs Query Analyzer, he is able to
> > see and select from the other dbs (master,
> > pubs, Northwind etc...). Is there a way
> > that I can make it so he can only see the
> > one db and not the others?
>
>


Relevant Pages

  • Re: Move databases between servers
    ... What I'm trying to do now is to copy master. ... Now I'm reinstalling sql with identical version, and restore all databases ... Since the logins are in master and operators/agents are in msdb why I ... copy all database and log files to new server ...
    (microsoft.public.sqlserver.setup)
  • Re: Move databases between servers
    ... Tell me why you need to move master, msdb, and model? ... When you restore databases on your other server SQL Server adds ... If you have lots of jobs defined you could try restoring MSDB. ...
    (microsoft.public.sqlserver.setup)
  • [SLE] One way sharing!!
    ... Global parameter guest account found in service section! ... Server role: ROLE_STANDALONE ... logon drive = P: ... preferred master = No ...
    (SuSE)
  • Re: Suse 9.0 getting samba to work (kinda)
    ... Double click on the Linux icon in Net ... > server string = Samba Server ... > map to guest = Bad User ... > preferred master = No ...
    (alt.os.linux.suse)
  • Re: Move databases between servers
    ... It is possible to restore master, but it is a complicated process and it ... databases just as you are planning on doing. ... Since the logins are in master and operators/agents are in msdb why I ... copy all database and log files to new server ...
    (microsoft.public.sqlserver.setup)