Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 3rd, 2004, 10:39 AM
Registered User
 
Join Date: Dec 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Select to all user tables in db

Help creating a stored proocedure that give select permissons to all user table in a database?

Thanks
Moueg
 
Old December 4th, 2004, 06:48 PM
Authorized User
 
Join Date: Oct 2004
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Are the number of tables stable or do they vary frequently?

Are the people who require SELECT access fairly stable or do they vary frequently?
 
Old December 5th, 2004, 10:46 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Try to select table names from the sysobject system table that has type as "U"

select Name from sysobjects where type = 'u'

For every NAME in the above query run the Grant statement to set appropriate permissions for the user/users that you prefer.

Grant SELECT on TABLE_NAME to USERS_Seperated_by_Comma.

Hope that helps.
Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old December 6th, 2004, 09:30 AM
Registered User
 
Join Date: Dec 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by happygv
 Try to select table names from the sysobject system table that has type as "U"

I'd actually like to automate this process through the use of Stored proc. The purpose for this is to avoid giving users direct access to base tables. I'd to just give them EXECUTE permissions to Stored proc.

Thanks!
Moueg


select Name from sysobjects where type = 'u'

For every NAME in the above query run the Grant statement to set appropriate permissions for the user/users that you prefer.

Grant SELECT on TABLE_NAME to USERS_Seperated_by_Comma.

Hope that helps.
Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old December 6th, 2004, 09:35 AM
Registered User
 
Join Date: Dec 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The tables do not vary much and users are fairly stable. I'd to give SELECT access to all user tables through a stored procedure.

Thanks!
Moueg

Quote:
quote:Originally posted by digby_dog
 Are the number of tables stable or do they vary frequently?

Are the people who require SELECT access fairly stable or do they vary frequently?
 
Old December 13th, 2004, 10:56 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Can you post the code that you have written so far to accomplish this. Let me take a look at it and suggest you to go further on this.

Cheers!

_________________________
- Vijay G
Strive for Perfection





Similar Threads
Thread Thread Starter Forum Replies Last Post
Select Count from multiple tables aspless SQL Language 1 January 30th, 2008 10:32 AM
Select from Two Tables Problem gaurav_jain2403 SQL Server 2000 2 May 18th, 2006 07:18 AM
select from 66 tables using checkboxes - how gilgalbiblewheel Classic ASP Databases 29 August 11th, 2004 12:31 AM
Select lot tables... vieritlc Classic ASP Databases 3 May 18th, 2004 07:07 AM
Grant SELECT on multiple tables oidhche SQL Server 2000 3 June 16th, 2003 06:26 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.