Solved

User to run a stored procedure

Posted on 2012-03-23
6
405 Views
Last Modified: 2012-03-26
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
Comment
Question by:Philip Pinnell
6 Comments
 
LVL 69

Assisted Solution

by:Scott Pletcher
Scott Pletcher earned 167 total points
ID: 37757532
Create a login and user for them.

Grant that login connect (only).

Grant the user EXEC authority on that one stored proc (only).
0
 
LVL 69

Expert Comment

by:Scott Pletcher
ID: 37757537
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
 
LVL 13

Author Comment

by:Philip Pinnell
ID: 37757739
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
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 
LVL 12

Assisted Solution

by:sachitjain
sachitjain earned 167 total points
ID: 37761964
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
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 166 total points
ID: 37762930
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
 
LVL 13

Author Comment

by:Philip Pinnell
ID: 37765571
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

776 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