GRANTING a variable

From: Wayne (anonymous_at_discussions.microsoft.com)
Date: 02/25/04


Date: Wed, 25 Feb 2004 03:19:44 -0800

When exec.
>>>
GRANT SELECT ON @variable_name to user_name
>>>

The above does not work due to the variable.
Is there no way of dynamically assigning the table-name?

Thks again.



Relevant Pages

  • Re: Permission to Insert records for DB USERS
    ... To add to the response by Vyas, consider creating your own database ... EXEC sp_addrole 'Supervisors' ... GRANT SELECT ON MyTable TO Supervisors ... > I am a fresh developer for the SQL server and have no Idea> for the permissions on the database. ...
    (microsoft.public.sqlserver.security)
  • Re: grant execution permission
    ... execute permission to the user/role: ... EXEC sp_addrolemember 'MyRole', 'MyDomain\MyUser' ... GRANT EXEC ON MyProcedure TO MyRole ...
    (microsoft.public.sqlserver.security)
  • SMS SP2 db upgrade errors
    ... NULL exec sp_addrole 'smsschm_users' DECLARE @pwd varcharSET ... OPEN newviews FETCH NEXT FROM newviews INTO @viewname WHILE ... SELECT ON Report TO webreport_approle GRANT SELECT ON ... DrillThroughColumns TO webreport_approle GRANT SELECT ON Dashboard ...
    (microsoft.public.sms.admin)
  • Re: DENY ALL for all tables
    ... grant select to the tables ... exec sp_addlogin new ... setuser 'new' ... grant select on new.table1 to SQLREADERS ...
    (microsoft.public.sqlserver.security)
  • Re: Login account scripts
    ... EXEC sp_addlogin 'User', 'Password', 'DefaultDB' ... To allow permissions on tables, you can use fixed roles, ... also grant permissions on objects with the grant statement ... >in the default database? ...
    (microsoft.public.sqlserver.security)