How to restrict SQL server profiler to show my symmetric key password while executing query from C# code?
Don't execute the statement as a string by using sp_executesql

Execute the statement directly:

OPEN SYMMETRIC KEY sym_RegAna_Default DECRYPTION BY ASYMMETRIC KEY asym_RegAna_Default WITH PASSWORD = 'admin@123'


That way, SQL Server is able to parse the statement and will notice that it's a command that contains sensitive information and will not show it in any trace output.

it will show up as:

--*OPEN SYMMETRIC KEY----------------------------


Please be aware that this applies to ALL statements that contain passwords. So also when you create the keys.