Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 431
  • Last Modified:

User to run a stored procedure

MS SQL 2005/2008

Is there a simple way to allow a user to run a predefined stored procedure when they need to without allowing any other interaction with the database.

TIA
0
Philip Pinnell
Asked:
Philip Pinnell
3 Solutions
 
Scott PletcherSenior DBACommented:
Create a login and user for them.

Grant that login connect (only).

Grant the user EXEC authority on that one stored proc (only).
0
 
Scott PletcherSenior DBACommented:
Of course you will need to have created the stored proc not with the default of EXECUTE AS CALLER.  Instead, using EXECUTE AS 'other_user_name' would be easiest, to give the proc sufficient authority without giving it to the calling user.
0
 
Philip PinnellAuthor Commented:
I was thinking more in terms of a front end rather than using Query analyser/SSMS as the users are not technical.

Just a select and click sort of solution.

I could write one myself I guess but wanted to avoid reinventing the wheel.
0
Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

 
sachitjainCommented:
What kind of interface do you want to give to your user to run that stored procedure?

If through SQL Server Management Studio then create a login for your user in desired SQL Server instance, create user for that login in desired database and give only execute permission (no other permissions on any other object) to created user over that stored procedure.

If you want to create some sort of app through ASP.Net or something as interface to user for executing stored procedure, that is also possible.
0
 
Anthony PerkinsCommented:
I was thinking more in terms of a front end rather than using Query analyser/SSMS as the users are not technical.
You could always write a batch file with SQLCmd.
0
 
Philip PinnellAuthor Commented:
Thanks for your suggestions.

I have decided to do a dotnet console app and if I had decide that to begin with I'd have it implemented by now :-)
0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now