Granting EXEC to all my user sprocs in one hit

From: Alec MacLean (alec.maclean_at_copeohs.com.NO_SPAM)
Date: 04/26/04


Date: Mon, 26 Apr 2004 19:06:10 +0100

Hi,
(I'm a web-programmer, having to double as a DBA, so please forgive me if
this is a stupid question!)

I've been trying to determine if it is possible to:

1. Retrieve all my user-created sprocs for a specified dbo (to a temp
table), then
2. Grant the EXEC privilege to these user-sprocs only (excluding the system
sprocs).

OR:
3. Grant the EXEC permission using SEMgr across all my user-sprocs at one go
instead of bashing the daylights out of my spacebar.

I'm trying to achieve this because I have two dbo's: one production and one
dev.
I'm detaching the live copy and copying the files across to dev machine,
then re-attaching them in their respective places, in order to get a
snapshot of the data in the production version across to my dev copy (for
testing report queries and saving me creating a LOAD of fake data).

# because of the relationships and number of tables, exporting data from
master to dev is a PITA, as I'd have to purge all the dev tables and set
identity insert on the export transformation - I suppose I ought to build an
admin-only procedure to do all this...:( #

Once I've re-attached the dev copy, I've found I have to remove the assigned
built-in account from the dbo's user list and re-add the user. This then
means I've got to add the exec permissions as well, which while not a
difficult task in SEMgr, it is a pain to do this way as I currently have
over 200 sprocs.

I see that the GRANT syntax allows me to set the permission, but only for
one sproc at a time. If I can retrieve a list of the "usp_" prefixed sprocs
for my specific dbo, I could put these in a temp table, then loop this and
set the permissions.

Surely this type of info is available in one of the system tables, as this
must be how the SEMgr permissions dialog is populated?

TIA for any help.

-- 
Alec MacLean


Relevant Pages

  • Re: needed help on MINICOM
    ... I have pasted the permissions for all ttyS0 ..s3 ... [root@localhost dev]# ls -lrt ttyS2 ... >> i have verified the same setup in windows using hyperterminal it is ... then what are the permissions on /dev/ttyS3? ...
    (Fedora)
  • Re: Child domain public folder issues
    ... grants access by mapping the mailbox granted to the Windows account. ... grant permissions the normal way. ... Servers group exist in your dev domain and contains your Exchange ... Although it does not contain an Exchange server; ...
    (microsoft.public.exchange.admin)
  • Restore Issue - My Site
    ... I have done a restore of my portal and WSS setup onto another Dev ... Server. ... I know I have the permissions. ...
    (microsoft.public.sharepoint.portalserver)
  • Re: Adp and SQL Server is there a way to query SQL permissions to control userforms?
    ... Use Windows authentication, and give some ... groups access to some sprocs and views and not to others. ... If you give me delete permissions for a view, ... Can you not design your app so it connects with a SQL Server account rather ...
    (comp.databases.ms-access)
  • Re: [SLE] usb scanner only work as root after upgrade to SUSE 10
    ... Which dev? ... the permissions of /dev/usbscanner0 ... But with SuSE 10 I have no idea which device it use. ... Check the headers for your unsubscription address ...
    (SuSE)