Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Granting permission

Author  Topic 

YM
Starting Member

3 Posts

Posted - 2006-10-08 : 23:29:16
Hi

I need to grant SELECT permission for ALL TABLES for tables which are tag to role (eg. ABC).

How do i grant them "permanently"? as the tables o/p by role (ABC) will be dropped and recreated when another users rerun the tables?

Appreciate any help.

Thanks very much!!

timmy
Master Smack Fu Yak Hacker

1242 Posts

Posted - 2006-10-08 : 23:33:31
Why are you dropping and recreating tables on the fly??

If you must do this, you should issue a GRANT SELECT command after you've created the table.
Go to Top of Page

YM
Starting Member

3 Posts

Posted - 2006-10-08 : 23:36:08
It's actually done thru the front end application.

On the front end, user can run report which recreates tables (i.e. drop and recreate) at the backend SQL.

But i need to restrict user to perform SELECT only when login thru the backend SQL.

Any idea?

Many Thanks!
Go to Top of Page

timmy
Master Smack Fu Yak Hacker

1242 Posts

Posted - 2006-10-09 : 00:53:12
If the user created the tables, then surely they will be able to read from them?

If not, you just need to issue the GRANT SELECT statement to alter the permissions.

Or you could design it so you don't need to dynamically create tables.....
Go to Top of Page

YM
Starting Member

3 Posts

Posted - 2006-10-09 : 02:00:22
that's the problem. The ID logs thru the application and uses another role (ABC) to o/p those tables.

But logging going thru the backend, the ID is tagged with another role which do not have SELECT.
I can set SELECT for once so ID can do SELECT. However, as the tables are dropped and recreated, i cannot be performing
the GRANT SELECT "automatically" or on the fly.

Is there a command that i can always set GRANT for the IDs (assume its role is VIEW) where tables are o/p by ROLE=ABC?

Go to Top of Page
   

- Advertisement -