SSMS shortcut to navigate between open query windows - sql-server

I sometimes have a large amount of query windows open in SSMS 2008.
Is there a keyboard shortcut to navigate between open query windows? Go to previous/next open query window?
I know there is Ctrl+Tab that allows you to select a query window, but it's only helpful if you have named windows.

A challenge you'll find here is what does "next" really mean? Since you can tear off tabs, split the UI, even move tabs onto different monitors, I think "next" and "previous" lose a little meaning, unless you know what order they were opened in.
Anyway, some solutions, with older versions (based on when the question was asked) left intact:
SSMS 2008
Ctrl+F6 will switch between two most recent tabs. And honestly, Ctrl+Tab / Ctrl+Shift+Tab work like next/previous except you have to hit Tab twice (you can ignore knowing what the name of the tab in the list is).
SSMS 2012
Ctrl+F6 will cycle through open tabs in the order they are displayed, and Ctrl+Shift+F6 will cycle in the reverse direction.
Ctrl+Tab / Ctrl+Shift+Tab will open a temporary window and allow you to cycle through open queries in the order they were last opened.
In more recent decades
Ctrl+Alt+[Page Up|Page Down] will cycle through windows (as bridge_burner added), but there's a catch. This only works when the query window is active - and it will stop working if you get to a query window where, previously, you had an item in the grid selected, for example.
You can make your own keyboard shortcut, as Stuart Smith explains.

the equivalent of Ctrl+Tab in browsers for SSMS would be Ctrl+Alt+PageDown for next tab and Ctrl+Alt+PageUp for previous tab.

Here's my approach that get's me closer to coding utopia. Make sure you keep your SSMS query windows sorted by name from left to right. SQLQuery1.sql, SQLQuery2.sql, etc. These are the default names SSMS gives these tabs when you create them (by clicking New Query).
To change the current query window tab, press "alt" then "w" then "w". A window is shown listing all of your open query windows sorted by their names (which should be the same order in which you have them laid-out from left to right). Use the up and down arrow keys to highlight the tab you want to activate and press enter. Your desired tab should be open now.
This allows me to quickly change query windows while keeping my fingers on the keyboard (less mouse usage).

I know this is a very old thread, but I thought I would add one more suggestion in case someone else comes across this: Redgate's SQL Prompt comes with a nifty "Tab History" applet that gets added as a button to a toolbar. I know that that means you would have to leave the keyboard and reach for the mouse to access it, but the interface and its functionalities are worth it! Not only do you have access to the currently opened tabs (with visual mini previews of the code in each tab) but also you have access to recently closed tabs (Yes, it may save you in case you accidentally close a tab without saving your work...)
Just my two cents. Best, Raphael

I found a way to map the browser style next/previous tab shortcuts in SSMS.
Select Tools > Options. Under 'Environment' select 'Keyboard'. In the 'Show commands containing:' area type 'Window.'.
Find 'Window.NextTab'. Toggle the 'Use new shortcut in:' to 'SQL Query Editor' then enter Ctrl + PgDn in the 'Press shortcut keys:' area and select 'Assign'. Do the same steps for 'Window.PreviousTab' with Ctrl + PgUp.
SSMS Keyboard Shortcuts Screenshot

Related

Showing or hide line numbers at SSMS with shortcut?

Is it possible to use a shortcut for the showing or hide the line numbers at the SSMS ?
I know its possible to go to the settings and to do it.
But is there really no shortcuts for it? If I see it right, I cant even sets shortcut keys keyboards setting for it.
Its would be very usefull, if available.
This link will help you to enable Line number in the SSMS query window
Click here
No, according to the current documentation there is no keyboard shortcut to control line numbers, you enable or disable from the Options dialog (Text Editor > All Languages > General).
See the official documentation

MS Access form doesn't update for a file's copy

I have a form in which I have a combo box, this combo box is a select name from table from an sql server . Then I have multiple listboxes which query different tables.
I have an event after update for re-querying the data when I choose a value from the combobox. Everything works great.
The problem appears when I make a copy of the .accdb file. I click on the drop down in the combo box to select a name (the list appears) and then nothing happens unless I click on refresh all (If I do it, everything looks great again). Which is strange because I made NO modifications to the copy. Simply copy paste.
What can be the cause of this? It is driving me insane
Sounds like security settings.
You have told Access at some point that your original file is safe and that it should enable its (VBA) contents.
In the copy you should see a yellow bar where you can enable the code.
If the yellow bar isn't there, see MS Access 2010, how to get the yellow Enable Content bar to show up again?

How to close the view in Kdevelop?

Kdevelop allows for split views (splitting the editor window horizontally or vertically) like known from Emacs and other editors. There are even shortcuts to create such splits (Ctrl+Shift+T, Ctrl+Shift+L), but I couldn't find any shortcut to close view. How to close the view in Kdevelop? I feel that this is rather stupid question, but I checked menus, shortcut list, context menu and see nothing about that...
The KDevelop editor is based on Kate, so you'd think that using the equivalent Kate command to close a view (Crtl+Shift+R) would work, but it doesn't seem to be implemented. Many of the Kate shortcuts are available to be assigned in the Configure Shortcuts dialog, but again, not close window.
The only canonical way to close the view is to close all the open files in it.
It's sub-optimal, but if you are desperate for a keyboard shortcut, Crtl+Shift+W will close all but your current document, which has the side effect of also removing any other views.
This might be a good candidate for a feature request.
It appears that there is no keyboard shortcut for this feature.
But, as of KDevelop 5, you can grab an edge of the split and drag it all the way up for a horizontal split and to all the left or right for a vertical split. This will close the other split view.
Any files opened in the other split view will be closed.

How can I disable the Start button (but not the Taskbar) on Windows 7?

On Windows XP, it was possible to disable the Start button with the following code:
hTray = FindWindow (TEXT("Shell_TrayWnd"), NULL);
if (hTray)
{
hStartButton = FindWindowEx(hTray, NULL, TEXT("Button"), NULL);
if (hStartButton) ShowWindow(hStartButton, FALSE);
}
For a public-access computer configuration, I need to be able to do this on Windows 7. The Start button must be disabled (not just hidden), and the remainder of the Taskbar must still be visible and usable. Hiding the Taskbar along with the Start button is not an option. Running full-screen is not an option. Using "Start Killer" won't work because it doesn't actually disable the Start button, just hides it (users can still use hotkeys to pull up the Start menu).
I have already tried the method that uses FindWindowEx with 0xC017 as its third parameter and then tries to disable that window. It doesn't work. That method only works if the whole Taskbar is disabled first. What I need is a method that only disables the Start menu, just like the code I reproduced above does in XP.
Any help is greatly appreciated.
The "correct" version for Windows 7 is as shown below:
HWND hStartBtn = FindWindowEx(NULL, NULL, MAKEINTATOM(0xC017), TEXT("Start"));
if (hStartBtn != NULL)
{
ShowWindow(hStartBtn, FALSE);
}
However, this only disables the button, meaning you won't get the glow or other effects by hovering your mouse cursor over it. You can still click the button region on the taskbar to open the menu. Apparently, the click handler is now implemented in the taskbar window itself, not as part of the separate Start button. That's why you have to disable the entire taskbar first, and consequently why most of the solutions you've found online do precisely that.
However, it looks like the "Start Killer" application now has functions to disable the most common hotkeys that trigger the Start menu, namely Ctrl+Esc and the key. You'll find those options by launching the software, right-clicking on its icon in the taskbar, and selecting "Options" from the menu. You can also edit the Registry to disable the Windows key, as described in this knowledge base article. If you wanted to implement this same functionality yourself through code, the only solution would be a low-level keyboard hook that trapped the keypress events that are responsible and discarded them.
Undocumented hacks like this one are given to breaking with newer versions of Windows. I imagine that Raymond Chen would chuckle and say something like "I told you so". Hacking the Windows interface is a fool's errand. Or, as you say several times in the question, "is not an option".
IS there anything in particular about the start menu you need to disable? You may be able to do the same via policy settings or various other file permissions.
Use one of the available group policies listed here.
You did not mention why you want to disable the start button. If you think about what exactly it is that you don't want your users to do instead of telling us the solution you picked for it (i.e., "disable the start button"), you might come up with a much better solution.
For example, if you want to prevent users from changing certain settings, block that, not the start button!
Or if you don't want them to see all the installed apps, hide those apps instead of the start button!
Or...
(I hope you see my point here).

word addin tool tips and balloons

Do you know of a way to show a tool tip ( or a balloon) similar to that, that appears in MS word 2007 and 2010 when you select a text and move you're mouse over it ( the one containing font options and other options) , from within an addin ?
Not without a LOT of work.
Word doesn't source any events of the mouse moving. About the only thing you get is the selection changed and the docchanged events, and those aren't terribly useful.
You could hook into system wide mouse events via API stuff and monitor it.
Alternately, you could poll, say, every second or two, for the active selection location in the document and check your context from the selection, and then pop up your own tooltip window. Gotta be careful with polling though, or you could swamp the machine and introduce a drag on performance.
And finally, depending on what you need, you could use the AutoTextList field in Word. It is the only field type that has a "tool tip" argument. Whatever you enter for that argument is displayed as a tooltip by Word whenever you hover over that field.

Resources