Solved

SQL Server EXEC sp_helprotect

Posted on 2011-03-08
5
1,252 Views
Last Modified: 2012-06-27
I find that there are lots of tables granted to PUBLIC in SQL Server 2000 when I run the EXEC sp_helprotect
Is this the default setting?
If granted to public is that mean everyone can access it?
Any table should NOT grant to public?
anyone can help?
0
Comment
Question by:mawingho
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 17

Accepted Solution

by:
dbaSQL earned 500 total points
ID: 35078212
0
 

Author Comment

by:mawingho
ID: 35078292
thank you! I have read it, but... still don't understand...
I have to check my client's SQL Server to see if grant everything to public is it valid?
0
 
LVL 17

Assisted Solution

by:dbaSQL
dbaSQL earned 500 total points
ID: 35078434
No, not necessarily.  Users are automatically added to the public role by default, when the logins are enabled at the database.  This role provides the permissions any new user has in the database.  Every login is a member of public, and inherits the public role privileges.

But -- by default, the role has only the very basic connection permissions.  Unless somebody has revoked or granted explicitly, I don't think you have anything to worry about.
0
 
LVL 17

Assisted Solution

by:dbaSQL
dbaSQL earned 500 total points
ID: 35078467
and you can take a look at this to see your public role privileges:


SELECT a.[name] + ' ' + v.[name] + ' ON ' + QuoteName(oo.[name])
+ '.' + QuoteName(o.[name]) + ' TO ' + QuoteName(u.[name])
   FROM dbo.sysprotects AS p
   JOIN master.dbo.spt_values AS a
      ON (a.number = p.protecttype
      AND 'T' = a.type)
   JOIN master.dbo.spt_values AS v
      ON (v.number = p.action
      AND 'T' = v.type)
   JOIN dbo.sysobjects AS o
      ON (o.id = p.id)
   JOIN dbo.sysusers AS oo
      ON (oo.uid = o.uid)
   JOIN dbo.sysusers AS u
      ON (u.uid = p.uid)
   WHERE  'public' = u.name
0
 

Author Closing Comment

by:mawingho
ID: 35121458
thanks
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question