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
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 New to SQL - need to sign permissions to tables

Author  Topic 

j-mo
Starting Member

2 Posts

Posted - 2010-08-02 : 15:10:31
Hello,

I am a Windows admin and occasionally get tasked for SQL stuff. Seems a that I am getting more and more these days. I need to assign a new users some specific table permissions and need help getting started. Btw - this is SQL 2005.

The text of the request is as follows-

"Please create a new login "website_updater" on the ABC production database with insert/update/delete permission on all website_* tables"

I have created this new user but am unsure about the permissions part. I have been reading about Schema permssion capabilities in 2005. I can also see the tables on my ABC database. Should I go the schema route?

Any insight would be greatly appreciated!

Thanks!

X002548
Not Just a Number

15586 Posts

Posted - 2010-08-02 : 16:15:04
This will gen the grants


SELECT 'GRANT INSERT, SELECT, UPDATE, DELETE ON ' + TABLE_NAME + ' TO website_updater' AS SQL
FROM INFORMATION_SCHEMA.Tables
WHERE TABLE_NAME LIKE 'website_%'
ORDER BY TABLE_NAME





Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

j-mo
Starting Member

2 Posts

Posted - 2010-08-04 : 15:29:34
Great! Thanks for the input. I will give this a try.

-J
Go to Top of Page
   

- Advertisement -