microsoft / azuredatastudio

Azure Data Studio is a data management and development tool with connectivity to popular cloud and on-premises databases. Azure Data Studio supports Windows, macOS, and Linux, with immediate capability to connect to Azure SQL and SQL Server. Browse the extension library for more database support options including MySQL, PostgreSQL, and MongoDB.
https://learn.microsoft.com/sql/azure-data-studio
MIT License
7.57k stars 901 forks source link

Support Results to Text #52

Open CobusKruger opened 6 years ago

CobusKruger commented 6 years ago

When executing a query, the results are shown in grid form. Sometimes it is more useful to have it as text, using spaces or commas. This is a configurable option in SSMS, which is great.

Steps to Reproduce: Execute something like:

execute sp_helptext MyStoredProcHere

The results are given in the grid, but it would clearly make more sense as text.

anthonydresser commented 6 years ago

dupe #86

kevcunnane commented 6 years ago

@anthonydresser - is this really a dupe? There are 2 issues:

I think this needs reopening (especially since I'm directing a twitter user in https://twitter.com/josephcooney/status/1059975197707649024 to track the "view result as text" issue), so that users can find this issue and see when it's actually fixed independent of the other option.

josephcooney commented 6 years ago

sp_helptext is exactly the use-case I was thinking of. Thanks @kevcunnane for re-opening.

sql-sith commented 3 years ago

This is one of the show-stopper gaps preventing me from including ADS in my normal daily workflow. Like others, I use text to grab sp_helptext results. But there are other use cases. For example, to post results into a code block (say, on GitHub or in Slack), it is very easy to do some light editing, such as using rectangular selections to change column width, before pasting the text into the app in question. I miss "results to text" every single time I use ADS. Even though it is faster to load, more lightweight, and so forth, there are just a few things that make it feel broken to me, and this one is near the top of the list.

erinstellato-ms commented 2 years ago

Logging additional request for this functionality after the ADS 1.35 release. This was logged from a community member here: https://feedback.azure.com/d365community/idea/a49e5d4e-5fb1-ec11-a81c-0022484ee92d

yahorsi commented 1 year ago

Guys this is very simple and key feature, what the hell such a basic functionality is still not available

ubbrownjr commented 1 year ago

I am also supporting the request for this functionality, especially for the "sp_helptext" use-case. Please give an update on the progress being made to include this feature.

erinstellato-ms commented 1 year ago

@yahorsi and @ubbrownjr Your support for this request is noted. Understand that while functionality may seem "simple", the implementation is not always such. We have a roadmap that includes improvements to scripting support, and this request aligns with that workstream. Know this is on our radar; there is a lot we want to do, and we are doing our best to get as much as we can completed as fast as we can. Thanks.

yahorsi commented 1 year ago

Just FYI i without it you cannot do one of most important thing for optimising queries - EXPLAIN ANALYZE

erinstellato-ms commented 1 year ago

@yahorsi Are you stating that you need to see the full text of the object in order to optimize it, or need to be able to view the query plan for the query in order to optimize? (the latter functionality already exists).

dmaloo commented 1 year ago

Erin, we use stored procedures that generate dynamic sql. A LOT. Many times we have to test the sql generated and returning results to text is the best way for us to grab the result. Thank you for prioritizing this. Mala

hucksy commented 1 year ago

I recently started using Azure Data Studio, and I really like lots of the functionality, but without results to text it's missing a key feature for my workflow. This is really a critical issue if this tool is going to be more widely adopted.

I just want to add the small weight of my vote to push this issue up! Thanks ADS team!

chris-tietgen commented 1 year ago

6 years later and this feature still hasn't been added to ADS.

barryseymour commented 1 year ago

I want this too!

fabiofer-br commented 1 year ago

Come on, friends... I am a huge fan of ADS since it started, but without something like the SSMS "Output as Text" it's impossible for us to migrate all we have from SSMS to ADS. We use it in procedures and long-running queries to output dynamic code that will be used elsewhere.

I'm pretty sure that LOTS of DBAs, Developers, IT Admins and all sorts of creative (and ingenious) guys and girls worldwide used it, a lot. I have been working professionally with MS SQL Server for over 25 years now (my MCSE certification is dated February 1998), I already saw many things on the wild in my developer life, and this is something that the users really need. Believe me.

Please, consider a way to give a solution for this. Let us finally migrate from SSMS to ADS and enjoy its awesome features.

erinstellato-ms commented 1 year ago

@fabiofer-br So...if we added "output as text" for the query editor, then everything you need would exist in ADS, and you could use that for 100% of your daily tasks?

I don't discount the value of this functionality - I've used it myself multiple times in SSMS! Just making sure I understand that if I asked you what is missing from SSMS that you absolutely MUST have in ADS, this would be the highest priority? Thanks!

yahorsi commented 1 year ago

@erinstellato-ms Lack of results to text closes many many super basic scenarios, it's absolute must-have functionality and lack of it is just embarrassing

ststo commented 1 year ago

@erinstellato-ms This is the only reason why I still have to open up SQL Server management tool regularly, namely for the text output. I always have to breathe a deep sigh when I have to open SSMS. We can do everything else in Azure Data Studio and it's a much nicer piece of software. We're already discussing all kind of workarounds so we don't need the text output any more, but it would make life a lot easier if that would be possible in ADS instead. I don't see any other reason why I would ever use SSMS again.

erinstellato-ms commented 1 year ago

@ststo Thank you for providing the additional context. I get that workarounds are annoying.

@yahorsi We acknowledge that ADS is not (yet) a complete product - but hopefully the community has seen that we are actively working on adding new functionality and addressing issues related to reliability.

In talking with engineering, we are going to review open issues for both result sets and query editor and see what we can tackle in the coming months. I mentioned this request specifically and I believe it's something we can pick up. I do not have a time frame (e.g. it's not going to happen next week), but I want you to know that we hear the feedback, and we are going to try to get this done. Please stay patient and look for updates in the release notes and here. Things typically show up in the Insider builds first, in case that's an option, and help with validating the experience once we've added it is always appreciated.

Thanks for taking time to share your perspective, we'll keep you posted.

fabiofer-br commented 1 year ago

@erinstellato-ms Thanks a lot for your message! 💯

My answer is YES 👍, in my specific situation, considering the scenario at my current job. Today, It's the main point that is blocking us to use only ADS easily. I'd like to note that we are a development team, so as developers our needs are different from the needs of the operations, infrastructure, or database administration teams. For us, generally the most relevant and priority points tend to be the ability to manipulate the data itself, the processing of that data, database objects, properties and so on.

ADS today has much more developer-related features and tools than SSMS (again, in our case), so ADS is a great tool for us. Server and environment administration features (which SSMS has a lot) and their related tools are not quite useful for us. Typically, developers don't even have the access rights to use them, in today's real-world scenarios.

Hope this helps! Thanks!

@fabiofer-br So...if we added "output as text" for the query editor, then everything you need would exist in ADS, and you could use that for 100% of your daily tasks?

I don't discount the value of this functionality - I've used it myself multiple times in SSMS! Just making sure I understand that if I asked you what is missing from SSMS that you absolutely MUST have in ADS, this would be the highest priority? Thanks!

erinstellato-ms commented 1 year ago

@fabiofer-br Thank you for the feedback, this is helpful! Is there anything, in your scenario on your development team, that you feel is missing from ADS and blocking you from using? Specifically, if I said, "in addition to results to text, what are two other must have things you need that ADS doesn't support, what would your answer be?"

Thanks so much, really appreciate your feedback!

barryseymour commented 1 year ago

Sometimes I write SQL that generates more code; maybe SQL, maybe PowerShell. In those cases, I need the output to go to a text file so I can easily save it to another file. ADS is more of a PITA in these cases than it's worth, so I have to switch to SSMS.

erinstellato-ms commented 1 year ago

Sometimes I write SQL that generates more code; maybe SQL, maybe PowerShell. In those cases, I need the output to go to a text file so I can easily save it to another file. ADS is more of a PITA in these cases than it's worth, so I have to switch to SSMS.

@barryseymour Thank you for explaining that scenario, it's a good one to understand, I've used it myself.

yahorsi commented 1 year ago

One more super basic scenario, for the MySql or PostgreSql, execution plan ius returned as text, after running EXPLAIN statement, so, currently, on the ADS, it's impossible to see any execution plan for MySql or PostgreSql

danpeps commented 1 year ago

I too am missing results to text. I have a keyboard query shortcut that does sp_helptext on the selected text (an object name in this case). In SSMS I'd hit Ctrl+T to switch to results to text so I can see an object definition quickly.

Another feature missing relates to the grid results... I miss being able to drag-drop values from the results grid into the editor like I can in SSMS.

I like a lot about ADS but without these 2 features I'm constantly switching back to SSMS because these features make me more productive.

Thanks for all the awesome work done so far!

tlunsfordCXP commented 1 year ago

Here's one that would be helpful that I'd expect to come with text output: Ability to find text within the results, including column headers. Would also be helpful in grid results.

erinstellato-ms commented 1 year ago

Here's one that would be helpful that I'd expect to come with text output: Ability to find text within the results, including column headers. Would also be helpful in grid results.

@tlunsfordCXP Making sure I understand your request here - you're asking for search capability in the results (whether text or grid), correct?

GaTechThomas commented 1 year ago

Here's one that would be helpful that I'd expect to come with text output: Ability to find text within the results, including column headers. Would also be helpful in grid results.

@tlunsfordCXP Making sure I understand your request here - you're asking for search capability in the results (whether text or grid), correct?

Exactly.

erinstellato-ms commented 1 year ago

@GaTechThomas Can you please add your comment and upvote this issue (https://github.com/microsoft/azuredatastudio/issues/23427) as that is more appropriate to your request? Thanks!

tlunsfordCXP commented 1 year ago

Ugh I just realized that I'm bouncing between ID's. @erinstellato-ms - thank you, I just upvoted and commented in #23427.

NightmoonFF commented 1 year ago

I also vehemently support implementing this feature. I've been tearing my hair out for the past four hours trying to find a solution

rwestMSFT commented 1 year ago

As a content developer working in the Database Docs team, using Azure Data Studio on macOS, I need this feature to avoid having to spin up SSMS on a Windows VM, just to be able to paste query results into my articles.

sql-sith commented 1 year ago

As a content developer working in the Database Docs team, using Azure Data Studio on macOS, I need this feature to avoid having to spin up SSMS on a Windows VM, just to be able to paste query results into my articles.

That's messed up.

erinstellato-ms commented 1 year ago

@sql-sith Are you a Windows, macOS or Linux person? Just curious :)

sql-sith commented 1 year ago

Hi, @erinstellato-ms. I use all three, but currently, I use macOS the least (my typical use case for macOS is helping other people to connect to SQL Server using domain/Windows/Kerberos authentication).

As for ADS, I use it mostly from Linux. However, if I need to paste column-aligned output into a code block in Slack or Markdown or something similar, I may not use ADS because it has no option for column-aligned text output. If I do use SQL ADS and need to show the results in a monospaced environment, I will have ADS save it to a CSV file and then run something like this:

$ column -t -s ',' my-query-output.csv > my-column-aligned-query-output.txt

This gives an OK approximation of what the text output option looks like in SSMS, without the hyphens to underline the column names.

Recently I have wondered what would be required to write an extension to enable text output. There are a couple of new skills I'd need to learn - which is great, but I'm busy :) - and I don't know how far down the product roadmap this feature might be.

If this is a direction you think would be worthwhile for me to pursue, can you DM me so we can discuss? Thanks.

erinstellato-ms commented 1 year ago

@sql-sith At the moment, we've got this as part of the November milestone, which means we are going to try and make it available in the next release. So watch this space :) hopefully you won't need to pick up extension writing skills right now! It would show up in the Insider build first, so if you happen to be an Insider user, I'm sure that any feedback you would have once it makes it in that build would be great to hear.

sql-sith commented 1 year ago

Thanks, Erin. I'm both happy, and somewhat disappointed, that I won't be doing this. Maybe I'll double back to a terrifying project I promised somebody at work that could be configured to patch, on the fly, operating systems so that apps that were never upgraded past 2.7.x would Just Work(TM), even if they explicitly demand use of the system Python installation.

This is the point in the conversation where you say I don't have to do this because it's in your November milestone. Any chance?

Thanks ;) Chris

erinstellato-ms commented 1 year ago

This is the point in the conversation where you say I don't have to do this because it's in your November milestone. Any chance?

For that second scenario, sorry to disappoint, but patching an OS on the fly will not be functionality in the next ADS release :)

sql-sith commented 1 year ago

Oh well, it was worth a shot. It's really just patching the system Python on the fly, which will be ... interesting. What's the first thing we teach me Python programmers? "Never modify the system Python installation."

Thanks for everything you folks are doing.

Nexusmeister commented 1 year ago

@erinstellato-ms Couldn't find a hint in the November Release Notes. So I guess it is coming with the next release or am I missing something? :D

erinstellato-ms commented 1 year ago

@Nexusmeister Ah, good catch. I suspect we had to push this out due to another issue that took priority (it's all a balancing act). Tagging @kisantia and @cheenamalhotra for awareness (I'm pretty sure they are both aware this is a highly voted and commented request, but making sure). Thank you for your patience!

sql-sith commented 1 year ago

I'm so glad to finally have this feature available! It is working fine for me so far.

My only nit is that the flat buttons to the right (Save As CSV/Excel/JSON, etc.) almost look like part of the query result. It would be nice if more were done to visually distinguish between those buttons and the query results as text. But to be fair, I thought the same thing when sending results to the grid was the only option, so it might just be my preference.

image

leighghunt commented 1 year ago

I'm so glad to finally have this feature available! It is working fine for me so far.

My only nit is that the flat buttons to the right (Save As CSV/Excel/JSON, etc.) almost look like part of the query result. It would be nice if more were done to visually distinguish between those buttons and the query results as text. But to be fair, I thought the same thing when sending results to the grid was the only option, so it might just be my preference.

image

Can't seem to find this is my just updated version - is this the latest release? I'm running v.1.47.0.

Version: 1.47.0
Commit: c7c2b2f21505562d21972d4c135119d00806db4f
Date: 2023-11-07T17:19:19.203Z
VS Code: 1.82.0
Electron: 25.8.4
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Darwin arm64 23.0.0
sql-sith commented 1 year ago

Sorry, @leighghunt, I must have had too much time on my hands yesterday. That's just a mock-up I made of the (still-not-released) feature. I must have thought it would be fun to confuse @Nexusmeister or something yesterday. But today, I realize that it was just a dumb thing to do. ;)

At least I got to exercise my paint.net skills a bit. It was a nice break from my day job. Again, I apologize.

erinstellato-ms commented 12 months ago

@sql-sith I fully understand that you may be frustrated that this feature did not make the 1.47 release of ADS. I do hope you understand there are multiple factors at play for every release, and often we are not able to share every detail as to why something is not available when we anticipated it would be. There is no deception or sleight of hand here, this feature unfortunately didn't make 1.47. We are doing our best to make it available as soon as we can.

sql-sith commented 12 months ago

Hey Erin (and everyone), that post of mine was a dumb prank (as well as a dumb idea).

I'm not frustrated at all. In fact, I saw you mention someplace that this feature is an XL on your board, so doing it up to ADS standards is clearly not at all trivial. I thought it might make somebody chuckle on the level of an April Fools joke, but that's not appropriate in a repo discussion.

This was a complete lapse in judgement on my part, and totally my bad. I sincerely apologize, especially because it confused some people here.

Chris

erinstellato-ms commented 12 months ago

@sql-sith Hey Chris - we're all good!

sql-sith commented 10 months ago

Hi, @erinstellato-ms! Just checking in. This feature doesn't seem to be present in the January Insider build, and I see that it's targeted for Feb 2024.

Here's a hypothetical scenario for you. Suppose I sent a medium your way (a good one, mind you) and have them read your mind. They are able to mind-meld with you because they lower your guard by bringing amazing GoDaddy swag and a 10 percent coupon in exchange for your time. Afterward, suppose I ask them to draw a line graph of how confident you've been, over time, that this feature would be released at its next target date.

That graph would have an upward slope, right? And be really, really close to the top on the right side? ;)

Remember, GoDaddy swag could be at stake here.

Sorry for the daydream there. I am not an Internet influencer; I'm more of a court jester. I'm looking forward to this, whenever it gets done, and somehow I'll miss this little thread when it is resolved.

dlevy-msft commented 10 months ago

Hi @sql-sith - While we always love some nice swag, it's not necessary.

We are actively working on getting this feature into the product, targeting the February release. That said, there are some unexpected challenges that may delay this work.

Keep an eye on this issue for the latest status.

auppencamp commented 8 months ago

Thank you for continuing to work on Results to Text. Very useful.