Solved

Best way to allow viewing of all SP's, tables etc

Posted on 2008-11-03
6
255 Views
Last Modified: 2012-08-14
Hi there

I have several people who would like to be able to view all Stored Procs (over 100), tables, views (basically all metadata) on ALL of the databases within a SQL instance in SQL 2000 & SQL 2005.

Rather than give them 'dbo' privilege on each database what would be the best way to allow them to view this sort of info.

I know SQL 2005 has the ability to grant the VIEW ANY DATABASE permission to a user but I also came across the GRANT VIEW ON DEFENITION SCHEMA option as well.  Does SQL 2000 have anything similar?

What would be the best way to allow them to view all the metadata info but still keep the environment secure?

Thanks
BravehearT-1326
0
Comment
Question by:BravehearT-1326
6 Comments
 
LVL 29

Expert Comment

by:QPR
ID: 22874368
db_datareader can view all tables and views in a DB - not sure about executing SPs.

When you say able to view SPs do you mean view the results or look at the code?
0
 

Author Comment

by:BravehearT-1326
ID: 22874570
QPR - thanks for replying.

They want to be able to view all the code of the SP's as they will need to compare like for like.  We only really have 1 schema in the database as well 'dbo'.

0
 
LVL 29

Expert Comment

by:QPR
ID: 22874949
can you test before giving it to them?
set up a new user and put them in the db_datareader role.
Login as this user and see if they can view the SPs - if so then you get what you want.
0
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 
LVL 60

Expert Comment

by:chapmandew
ID: 22882934
you could give them execute permissions on sp_helptext
0
 
LVL 26

Expert Comment

by:Zberteoc
ID: 22884861
In SQL 2005:

In Manegement Studio go to Object Explorer for that server, expand Databases, right click on the database you want select Tasks > Generate Scripts. This will open the Scripts Wizard. Follow the steps in there, you can set at the beginning if you wanted the drop scripts included and other options, and select all the objects you want to script out and in the final step choose to script to file and save it. If those can't do it by themselves then  just send the file to them.

There is similar way to do this in SWL 2000 even though the name of the options/steps might differ a little.
0
 

Accepted Solution

by:
BravehearT-1326 earned 0 total points
ID: 22995325
Best way I found to do it was issuing the command:

GRANT VIEW ANY DEFINITION TO Public

That way they can see all the metadata details but they cant amend / update

0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question