Changing Ownership - Granting SELECT perms in SQL 2005
03/03/09
Changing Ownership - Granting SELECT perms in SQL 2005
I had an interesting issue today. I was working with a product that needed select privileges to the sys tables and have ownership of the table it was going to use on a SQL 2005 Server. After trying various combination of permission settings. I came across the following two commands that did the trick for me.
Grant SELECT privileges to tables:
SELECT 'GRANT SELECT ON ' + TABLE_NAME + ' TO [user]' FROM INFORMATION_SCHEMA.Tables;
Change table ownership:
ALTER AUTHORIZATION ON [database].[table] TO [user];
Everything inside the [ ] are the portions that I had to change for my specific set up.
So if you ever need to grant select privileges tables or grant ownership to a table in SQL 2005, I hope this helps out.
Dave
Pingbacks:
No Pingbacks for this post yet...
This post has 1 feedback awaiting moderation...
Windows Tools & Utilities
A place to share interesting and cool windows related tools, utilities, and applications that might be helpful to folks.
Search
Follow Me:
Categories
- All
- Microsoft Tools (7)
- Open Source (4)
Archives
- September 2010 (1)
- March 2009 (1)
- January 2009 (2)
- October 2008 (5)
- More...
Misc
Who's Online?
- Guest Users: 2




