RE: GRANT Select to all tables on a DB

From: Sam (Sam_at_discussions.microsoft.com)
Date: 10/13/04


Date: Wed, 13 Oct 2004 15:35:05 -0700

Are there similar commands to iterate through all the Stored Procs on a
database, as well as all the views? Thank you again.

Sam

"SangHunJung" wrote:

> Sam,
> For all tables in one DB, for example,pub db
> use pub
> go
> sp_msforeachtable 'grant select on ? to RO'
>
> For all DBs, sp_msforeachdb will do.
>
> Cheers,
> SangHunJung
> "Sam" wrote:
>
> > I have three main database files on a SQL 2000 server. Each database has
> > about 200 tables. I need the ability to easily give a user SELECT for all
> > tables in each database. I can use the GUI, but it takes way too long. Please
> > help me figure out an easy way to enumerate all tables in the database, so I
> > can construct a GRANT Select statement.
> > Thanks.
> > S



Relevant Pages

  • Re: Alter Many Stored Procedures
    ... The group needs to be a member of the db_owner or db_ddladmin fixed database ... "SangHunJung" wrote in message ... > What permission do I need to setup for a developer in order to change many ... Developer windows group is added to ...
    (microsoft.public.sqlserver.security)
  • RE: GRANT Select to all tables on a DB
    ... "SangHunJung" wrote: ... >> tables in each database. ... >> can construct a GRANT Select statement. ...
    (microsoft.public.sqlserver.server)
  • Dynamic SQL in Stored Proc
    ... I have a database setup so that NO users have READ, ... Dynamic SQL and they have stopped working. ... error message when executing one of the stored procs. ...
    (microsoft.public.sqlserver.security)
  • Re: Syskey
    ... > I have a question about the syskey utility..does it encrypt the SAM ... SAM database but if you move it off the system, ... Here's more info on the syskey and what it does. ...
    (microsoft.public.win2000.active_directory)
  • Re: Confused about proc vs. dynamic SQL vs LINQ
    ... where people create stored procs which *just* call normal CRUD ... for no reasons other than dogma. ... theoretical "change the database and the procs implementation, ... It depends on the database server, but I believe that using a cached ...
    (microsoft.public.dotnet.languages.csharp)

Quantcast