Monday, March 26, 2012

Grant login permission on tables

Hi,
In my SQL Server 2000, how do I grant a login account permission for tables
in a particular database, using script, not by checking the checkboxes.
There are many tables in that database, and I am thinking using script, it
will be faster.
Thanks for help.
JasonIf the user already exists on the database try some of these
grant select on mytable to user
grant insert on mytable to user
grant update on mytable to user
grant delete on mytable to user
grant select, insert, update, delete on mytable to user
grant all on mytable to user
Hope this helps,
Ben Nevarez
Senior Database Administrator
AIG SunAmerica
"Jason Huang" wrote:
> Hi,
> In my SQL Server 2000, how do I grant a login account permission for tables
> in a particular database, using script, not by checking the checkboxes.
> There are many tables in that database, and I am thinking using script, it
> will be faster.
> Thanks for help.
>
> Jason
>
>|||Hi Jason,
Try this out:
select 'grant Select,Insert,Delete,Update on ' +name+ ' to [Username in
database]' from sysobjects where xtype='U'
Make sure user is already there in database.
Manu
"Jason Huang" wrote:
> Hi,
> In my SQL Server 2000, how do I grant a login account permission for tables
> in a particular database, using script, not by checking the checkboxes.
> There are many tables in that database, and I am thinking using script, it
> will be faster.
> Thanks for help.
>
> Jason
>
>

No comments:

Post a Comment