Solved

How to protect store procedure

Posted on 2009-04-04
13
171 Views
Last Modified: 2012-05-06
How i can protect store procedure from shared server. or i can make dll files of store procedure and used with asp.net
0
Comment
Question by:snbelani
  • 4
  • 4
  • 2
  • +1
13 Comments
 
LVL 57

Accepted Solution

by:
Raja Jegan R earned 334 total points
ID: 24068142
Use the Create Procedure "WITH ENCRYPTION" option to avoid others seeing the code of your procedure.
No need for converting it into CLR stored procedure using DLL files.
0
 
LVL 31

Assisted Solution

by:RiteshShah
RiteshShah earned 166 total points
ID: 24068241
WITH ENCRYPTION option is pretty cool in your scenario I guess. As long as possible, try to close to data for better performance rather than being closer to application. I agree with rriegan17, if it is possible, use SP in SQL Server only.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 24068636
Experts
For the record the author has asked 7 questions and has yet to close a single one.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 24068642
And incidentally, the only question that was not deleted (it was Force-Accepted) was identical to this question.  See for yourself:
http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SQL-Server-2005/Q_23854625.html
0
 

Author Comment

by:snbelani
ID: 24088975
I can not upload Store procedure from my end i have to deliver complied apllication along with Script for database which i generate from data publishing wizard so how i can encrypt store procedure?
0
 
LVL 57

Expert Comment

by:Raja Jegan R
ID: 24089328
As I mentioned earlier, add the WITH ENCRYPTION option while creating the stored procedure.
0
[Webinar] Disaster Recovery and Cloud Management

Learn from Unigma and CloudBerry industry veterans which providers are best for certain use cases and how to lower cloud costs, how to grow your Managed Services practice in IaaS clouds, and how to utilize public cloud for Disaster Recovery

 

Author Comment

by:snbelani
ID: 24569170
If i create sp with encryption, can i create sql query with data publishing wizard?
0
 
LVL 57

Assisted Solution

by:Raja Jegan R
Raja Jegan R earned 334 total points
ID: 24569560
If you use WITH ENCRYPTION, you wont be able to create the Script using Data Publishing Wizard.

If you wish to do that, Create the procedure and grant only Execute privilege to those who should not view the procedure code.
Say if you have a procedure named dbo.temp_proc and you have create procedure privileges over that db, then
1. create that procedure and you will be having full privileges over that procedure.
2. you will be able to execute and script that procedure either directly or through Data Publishing Wizard.

Now if we have an user named test and he needs only execute privileges and no scripting privilege, then issue the statement below:

GRANT EXECUTE ON dbo.temp_proc TO test;

Now test can only execute the procedure and he wont be able to view the procedure code or even through Data Publishing Wizard.

Hope this helps.
0
 

Author Comment

by:snbelani
ID: 24569977
My problem is,  in my web application i had near about 800 store procedures and i had to give to my client how i shall give sp in query form with encryption
0
 
LVL 31

Expert Comment

by:RiteshShah
ID: 24569987
>>My problem is,  in my web application i had near about 800 store procedures and i had to give to my client how i shall give sp in query form with encryption<<

do you want to encrypt all 800 SPs? or set rights as per rrjegan17 to 800 SPs?
0
 

Author Comment

by:snbelani
ID: 24583152
Yes, I do with encrytion with every store procedure after final testing.Now how should i deliver encrypt sp to client so that he can upload from his end
0
 
LVL 57

Expert Comment

by:Raja Jegan R
ID: 24588128
You need to deliver the procedure code using WITH ENCRYPTION option to your client and can be installed out there.
To create the procedure you can't do that with Encrypted one.
But while Creating the Procedure, you can prevent from others viewing the code later, you can use WITH ENCRYPTION.

Hope this helps.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Calculated columns 13 62
SQL Server Deadlocks 12 50
Add '#' to end of file 2 30
SQL - insert empty rows into output results 11 24
Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

920 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

13 Experts available now in Live!

Get 1:1 Help Now