Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL Server Profiler Extension not displaying Login Name #10393

Closed
raswinraaj opened this issue May 14, 2020 · 6 comments · Fixed by #10679
Closed

SQL Server Profiler Extension not displaying Login Name #10393

raswinraaj opened this issue May 14, 2020 · 6 comments · Fixed by #10679

Comments

@raswinraaj
Copy link

  • Azure Data Studio Version:1.17.1

Steps to Reproduce:

  1. Install SQL Server Profiler - version : 0.11.0
  2. Start Profiler Session by connected to an Azure SQL DB
  3. The table that is generated does not show the value of the Login Name even though the column is available. It is always empty irrespective of what user is logged in.
    image
@alanrenmsft
Copy link
Contributor

@raswinraaj the LoginName is mapped to the field server_principal_name of sqlserver package, and unfortunately it is not available for Azure SQL database. (it is available for standalone SQL Server), the views in Azure Data Studio is designed to be server type agnostic, unfortunately, you will always see these 2 columns without any values.

if you really want to get rid of this column, you can customize this view or add a new view:

  1. open the View menu group in the main menu bar
  2. select 'Command Palette...'
  3. run command: 'Preferences: Open User settigs'
  4. filter by the keyword: 'Profiler: View templates' - see first screenshot
  5. Click 'Edit in Settings.json' button
  6. you can now either remove the loginName column under the 'standard view', or make a copy of the view and then remove the unwanted columns.

Screen Shot 2020-06-01 at 6 05 03 PM
Screen Shot 2020-06-01 at 6 06 57 PM

@alanrenmsft
Copy link
Contributor

I am closing the issue since i have explained the reason and solutions.

@raswinraaj
Copy link
Author

@alanrenmsft My sole reason for raising this bug was because we have multiple users and we wanted to know which users' query execution was taking the longer duration during profiling. It is unfortunate that this feature is not available. Can this be raised as a feature request?

@alanrenmsft alanrenmsft reopened this Jun 2, 2020
@alanrenmsft
Copy link
Contributor

@raswinraaj I took another look and realized it is actually doable, for now as a workaround, please locate the LoginName column for the views that you are interested in (follow the steps in my previous comment) and update it to make it look like this:

                {
                    "name": "LoginName",
                    "eventsMapped": [
                        "server_principal_name",
                        "username"
                    ]
                },

I will make corresponding code changes to update the default templates to include this field.

BTW, please remove the customization when a new ADS version is released so that you can get the future new default templates.

thanks for bring this to our attention and let me know if you have any other questions

@alanrenmsft
Copy link
Contributor

@raswinraaj my fix has been merged, if you use the latest ADS insider build you will see the loginName being populated now.

https://github.com/microsoft/azuredatastudio#try-out-the-latest-insiders-build-from-master

@raswinraaj
Copy link
Author

raswinraaj commented Jun 13, 2020 via email

@adsbot adsbot bot locked and limited conversation to collaborators Jul 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants