Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hiding statements from SQL Server Profiler (or other observers)

In SQL Server 2008 R2, I would like to execute a statement that I want to be invisible to the SQL Profiler or other means of observing user queries. Is there a way to control what is displayed by SQL profiler?

I would like to execute something like:

SELECT 'MyPassword' INTO #passwordTable

I don't want to show 'MyPassword' through SQL Server Profiler or other means. Any ideas?

like image 591
Denis Avatar asked Dec 15 '22 19:12

Denis


1 Answers

Essentially, no, you can't. You used to be able to do this by adding a comment like this into the batch or statement:

-- sp_password

But this no longer works. Why aren't you hashing your password?

like image 69
Aaron Bertrand Avatar answered Dec 18 '22 10:12

Aaron Bertrand