Tuesday, March 27, 2012

GRANT SELECT for all tables

Is there a way to grant select on all tables with in a database using TSQL?
I don't like the idea of having to do it for every table...I'm looking for a
short cut..
Thanks in advanceIn SQL 2000, you can add an user to db_datareader fixed role. This role has
Select permission on all tables & views.
Dejan Sarka, SQL Server MVP
Mentor
www.SolidQualityLearning.com
"owenmj" <owenmj@.discussions.microsoft.com> wrote in message
news:8CE5A325-08E3-400C-9DFB-DBF3187F02F1@.microsoft.com...
> Is there a way to grant select on all tables with in a database using
> TSQL?
> I don't like the idea of having to do it for every table...I'm looking for
> a
> short cut..
> Thanks in advance
>|||In SQL Server 2005, you can grant SELECT on the database to achieve this.
Dejan's reply provides the answer for SQL Server 2000.
Laurentiu Cristofor [MSFT]
Software Design Engineer
SQL Server Engine
http://blogs.msdn.com/lcris/
This posting is provided "AS IS" with no warranties, and confers no rights.
"owenmj" wrote:

> Is there a way to grant select on all tables with in a database using TSQL
?
> I don't like the idea of having to do it for every table...I'm looking for
a
> short cut..
> Thanks in advance
>|||Thank you!
"Dejan Sarka" wrote:

> In SQL 2000, you can add an user to db_datareader fixed role. This role ha
s
> Select permission on all tables & views.
> --
> Dejan Sarka, SQL Server MVP
> Mentor
> www.SolidQualityLearning.com
>
> "owenmj" <owenmj@.discussions.microsoft.com> wrote in message
> news:8CE5A325-08E3-400C-9DFB-DBF3187F02F1@.microsoft.com...
>
>sql

No comments:

Post a Comment