Are there ways to change the format of SQL output in VSCode? - sql-server

Specifically, I've noticed a difference between SSMS and VSCode, when resizing a column of the output results. SSMS displays the column contents bounded by the resized width before you drop your mouse drag to complete the resize, while VSCode does not. Is there a way to get more user-friendly SQL results in VSCode?
I've tried briefly searching for popular sql vs extensions. Is this something which can be achieved with basic VSCode settings instead?
I'm assuming this decision was intentionally made for a performance trade-off, but I'm hoping this is something that either is currently, or will become a configurable option if VSCode will one day replace SSMS.

Related

Why is Visual Studio 2017's new AutoScale support resizing my Forms app at runtime?

We have a Windows Forms application used for testing our products that has had pretty much the same forms and dialogs for nearly 10 years now. AutoScaleMode in the designer is set to Font for both forms, and that hasn't changed since the original design. AutoSize is set to false and just for good measure (I guess) AutoSizeMode is set to GrowOnly. The following source lines are in Program.cs:
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Remember, this has been working flawlessly for years...
One of the recent updates to VS2017 included AutoScale support for monitors with different DPI. I have a relatively high DPI monitor, so when I made some changes to a Settings dialog (adding controls, etc) I started getting bright yellow banners cross the top of the designer surface telling me that AutoScaling was set to 125%, and would I like to change that? I tried going back and forth, and when in 100% mode (Autoscaling off) I was warned that XAML forms might not display correctly. Fine, I am working with Forms so I went back to "normal" scaling and the form looked fine.
Until I tried running the program. Now when I start the program the main form looks like this (details deleted to protect the guilty):
...but when I open the settings dialog it looks like this:
Yikes! It looks worse in practice, the relative images here don't do justice to the difference in size and scale.
I have no idea what got changed or how / why this is happening, but there's no way I can put this into production. I've tried changing the AutoScale settings, to no avail. Can somebody point me in the right direction here?
Thanks in advance!
EDIT: It seems the rescaling only happens on my machine when I run the app in Debug. Whatever is messing up the display of the forms on my machine doesn't do that on my associates' machines and isn't replicated to the executable produced by the build server.
On another note, I tried every DPI-related setting I could find, added those that weren't there due to the program's age, all to no avail. Nothing I have tried has had any effect on the program's display weirdness on my machine. Ugh.
I tried all the tricks I could find, short of disabling AutoScale completely, and nothing worked. I finally merged our develop branch in to my feature branch and inspected all 270 edits, choosing the oldest settings I could find for all size parameters, all controls. Ugh.
Along the way I stumbled across the following line in the Designer.cs file for the form:
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
This setting is NOT accessible from Visual Studio's designer, as far as I can tell, nor can I find anything about how or why it gets set. What I did find was that in the earlier version that did work as expected, the values were (8F, 17F) -- so I manually edited the line to match the older, working version. Success!
I also checked my Windows display settings, and the Custom Scaling value was at 100%, so I used the registry hack mentioned in one of the articles I found following the first link from the comment above (thanks, #Jimi) to disable auto-scaling in Visual Studio, then turned off the notification. Now I'm (finally) back in business.
Registry hack is here:
https://learn.microsoft.com/en-us/dotnet/framework/winforms/disable-dpi-awareness-visual-studio
If one uses the registry hack mentioned in the answer from DaveN59, and there is already entry for your ...\devenv.exe (mine was previously set to run as admin) then add the DPIUNAWARE string to the end of the "Data". Make sure to use a space as a separator.
Example: ^ RUNASADMIN DPIUNAWARE
I'm not sure what the ^ is for, but it was there and I just added DPIUNAWARE string. Also, if you just add this string, it will come up unscaled, but you will still see the yellow banner. To turn that off you'll need to select that option from with in Visual Studio. The instructions are in the link for the registry hack, also provided above. For conveinece here's the menu navigation path.
To disable notifications, choose Tools > Options to open the Options
dialog. Then, choose Windows Forms Designer > General, and set DPI
Scaling Notifications to False.

Oracle APEX 5 master/detail form -- detail region stopped working

I was adjusting some columns on a master/detail form and the detail interactive grid stopped retrieving rows. I'm not sure at what point exactly that it stopped working, but I think it was when I was using the quick edit to adjust the height of the region.
I tried putting everything back the way it was, but no luck. I added another interactive grid on the same table, linked by the same column to the master, and that works ok. I tried exporting the source and comparing the non-working grid to the working grid, to see if something was messed up in the source, but I don't know enough to figure out what differences are significant.
Any ideas on what might have happened? How I might be able to fix it, or at least avoid having this issue in the future?
I switched the interactive grid to an interactive report and saved it, then switched it back to an interactive grid again, and that seems to have resolved the problem.

Can I have multiple rows of tabs in SQL Server Management Studio

I'm wondering if it's possible to setup SQL Server to have multiple rows of tabs for files / queries.
I have a lot of queries I want to switch between, and could move them to different horizontal groups, but I think two rows would be much easier to navigate than that pin on the left that drops down the big list of open queries.
Visual Studio kind of supports this if you pin enough code windows to fill up the top bar.
Is there something similar in SQL Server?
Edit:
I'm trying to achieve something like this (screenshot from Visual Studio)
While SQL Server is more like this
It's now available in current ssms version. From menu => Tools => options:
By default SSMS includes Database name, File name, Login name and server name in each query tab title. So that we can see only 3 or 4 tabs at a time.
There is a work around for this,
go to Tools > Options > Text Editor > Editor Tab and Status Bar and change all of the "Tab Text" group options to false except for the file name.
This will reduce the tab name, so that SSMS will show more tabs at a time
I know of at least one plugin that will do this in SSMS (and Visual Studio). Because, yeah, it would be nice.
Tabs Studio - document tabs manager for Visual Studio IDE.
You can do this by pinning all the tabs. If tabs are pinned, they won't go out of sight but will go to the next tabline instead.
The last line in the picture is a result of "Show pinned tabs in a separate row" option described in this answer.
You can pin all tabs. Pinned tabs won't be hidden.
You can get a list of open tabs (Active Files) using the Ctrl-Tab shortcut. Continue pressing Tab to cycle through the list and release when the desired tab is highlighted. Or just mouse click on the required tab while keeping Ctrl depressed.
Some people do this by managing their files in an SSMS Solution and keeping the Solution Explorer loaded, but I find these to be inflexible and unwieldy.
SQL Prompt 6 has an "Open Tabs" list in the Tab History feature, which you might also find useful.

Any alternative report designers other than the traditional "banded" styles?

When I think of reports I think of banded reporting. Tools like Microsoft Access, Crystal Reports, SSRS and even VisualFox use this. Dynamic behavior must be anticipated in advance and is controlled through conditional fields, subreports and parameters. These reports are perfect for financial reports or lists of things where anytime you run this (typically between some date range) the look and feel is predetermined and expected by the user.
However our company requires a solution where any user should be able to change any aspects of the report. Fields, formatting and layout are all changed anytime a report is run. It's not a traditional "report" if you will since it's not a somewhat static output.
Resorting to banded reporting in this case would banish some developers to the world of crystal reports since we generate 2-6 reports on any given day. I can't imagine a typical user being happy with having to learn how to use crystal report designer either.
What are some alternative reporting solutions that allow you to build reports without being at the whim of learning an entire reporting suite such as Crystal Reports? I've added an answer of my own to show a great alternative that we're currently using and hope to get some good input for future use. The point of this post however is to collect some alternative solutions to the one proposed.
DevExpress Snap
With some digging we discovered DevExpress Snap which allows you to build reports using a Word Processor much like Microsoft Word by dragging fields from a fields toolbox right into the document! It feels exactly like Microsoft Word with data field drag and drop capabilities. Fantastic!
We've already created a Template structure so users can save their predetermined layouts as "general" templates to start work off of but nearly every report generated contains different fields and formatting. Sometimes even images are dropped into the document to illustrate a point.
Now I don't have to be banished to the land of SSRS! This is an amazing solution though I still generate certain reports (P&L for example) through SSRS since it should be a pre-set reporting style, with it's fields and design locked away from the user.
The other solution I found that looks pretty powerful and easy to use is Windward Autotag. It's an actual plug-in for Word that just adds an extra tab at the top of the ribbon for all your report options. So you can literally design all your reports right in Word. You put your data wherever you want by going to the Autotag tab added to the ribbon and clicking a button to insert your data where you want it. I haven't tried it yet, but the website and demo video look pretty impressive.

Is there a keyboard bindable command for reset layout in visual studio 2010 cider designer?

I'm using the Visual Studio 2010 WPF designer to lay out a window, and the Reset Layout function is proving very useful whenever I move something around as the designer defaults to specifying widths, heights, and massive margins to get it into whichever exact position I have dropped it in, making the automatic layout features of WPF almost useless unless I get rid of those specifications.
At the moment I am accessing this function by right-clicking on the control in question, selecting Reset Layout from the context menu, and then selecting All. As I'm not using any of the other options in here, and I'm using it a lot, I wanted a hotkey, but that's where I'm getting stuck.
I've looked in the Options->Keyboard window, but if there's a command for it there then I can't find it because it's not named unambiguously enough (I've searched for commands including Layout, and commands including Reset, and there's a few that -might- be it, but probably aren't right). I have searched the internet for any hint of a list of designer hotkeys, but what I have found is very limited, and never covered adding new ones.
Does anyone know what this command is called so that I can bind it using the Visual Studio keyboard hotkeys menu? Is it even available?
Alternatively, maybe I'm going about this wrong - is there a way of clearing the layout of a control when moving it around or dropping one from the toolbar that's quicker than putting it roughly where you want and using Reset Layout via the context menu? I could just edit the XAML directly, but I have a lot of controls to move around and I find it slower than using the menu.
Thanks
You can record a temporary macro, then view the code in the Macros IDE, which gives you the command names.
Unfortunately, these commands don't seem to be part of the VS command framework because they are not recorded. They must be internal to the XAML designer.

Resources