Encrypt SQL string or hide from SQL Profiler

David C
David C used Ask the Experts™
on
Hi Experts

Is there a way of encrypting a query when it is passed from a web app so that it doesnt show in SQL Profiler?

Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Why would you want to do this (other than for malicious purposes)?
 
sorry, it is not possible, you can encrypt string but not query.
Awarded 2008
Awarded 2008

Commented:
If you use a stored proc you can encrypt it
11/26 Forrester Webinar: Savings for Enterprise

How can your organization benefit from savings just by replacing your legacy backup solutions with Acronis' #CyberProtection? Join Forrester's Joe Branca and Ryan Davis from Acronis live as they explain how you can too.

if it's a simple select, you can create a view that perform that select and then encrypt the view definition
this way, all that the profiler will display is
select * from view_name
Awarded 2008
Awarded 2008

Commented:
momi, it depends on what events you've selected for yoru statement to be true.
David CIT Projects Manager

Author

Commented:
8080 Diver: Its not for malicious purposes, the selling point of the application I've created is in the querie's i.e. it knows where to go and look. I wouldn't want someone opening SQL Profiler seing everything that happens and creating their own program. I will use momi sabaq's answer i.e. create a view, encrypt it.

Since this will be installed on other peoples servers will it be possible to stop anyone else decrypting this query or can the sa do whatever?

If untrue is there any other way of protecting the application/queries?
Awarded 2008
Awarded 2008
Commented:
right, but make SURE that you encrypt it.....whether it is in a proc, stored procedure, etc.  And, make sure you have a bakup of the object before you encrypt it....because once it is encrypted, you can't see the definition of it at all.
best bet is to put everything in stored procs and encrypt them with WITH Encryption
Awarded 2008
Awarded 2008

Commented:
yep!
David CIT Projects Manager

Author

Commented:
Any advantages of a view over stored procedure?

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial