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

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
BravehearT-1326Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
BravehearT-1326Connect With a Mentor Author Commented:
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
 
QPRCommented:
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
 
BravehearT-1326Author Commented:
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
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
QPRCommented:
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
 
chapmandewCommented:
you could give them execute permissions on sp_helptext
0
 
ZberteocCommented:
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
All Courses

From novice to tech pro — start learning today.