0

We want to log sql events and its working but the problem is it always says sa as an user. Whereas I would like this to be personalized.

Is there anyway in ADO.Net where I can pass custom display name so that the logging of sql shows who the user is doing what in my DB?

I know this question looks quite wierd but this is how my requirement is. Any comments are highly appreciated.

1 Answer 1

1

Don't log-in as SA! That's a real big security problem just waiting to happen. Create other SQL users, and use them in your connection string. That will let you control which user is shown on the profile, and also add you quite a bit of security.

Note: You could also log in based on your Windows credentials, which is even safer in some production environments, but you might not want to worry about it right now.

Sign up to request clarification or add additional context in comments.

1 Comment

My Question is even if I change the user still SQL will log event for that user. Please note we are using one DB user for all our application user. Is there any way where we could pass custom display name to sql for event logging only.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.