Reputation: 715
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.
Upvotes: 0
Views: 289
Reputation: 39013
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.
Upvotes: 1