Solved

User to run a stored procedure

Posted on 2012-03-23
6
402 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:ScottPletcher
ScottPletcher earned 167 total points
Comment Utility
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:ScottPletcher
Comment Utility
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
Comment Utility
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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 12

Assisted Solution

by:sachitjain
sachitjain earned 167 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
SQL Server R2 Stored procedure performance 8 31
SQL Select Query help 3 30
replication - alerts? 4 19
Azure SQL DB? 3 13
In this article I will describe the Backup & Restore 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.
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
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…

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now