SQL Management Studio 2008 - Server name on Query Editor tabs...where did they go? - sql

I recently upgraded to SQL Management Studio 2008 (full not express, if it matters).
In 2005, when I was in the Query Editor, each tab (with an unsaved query) would have the servername-instance-query name or something like that, but all I cared about was seeing the server name there so I knew which server I was running my query on.
In 2008 it appears that they've decided to change the tab title to query name-servername, and the result of this is I can't see what server I'm working on without hovering over the tab and looking at the tooltip thing that pops up, which really slows me down. So currently all my tabs are titled something like "SQLQuery5.sql..." which is useless to me.
How can I get the servername back to the front the tab title?

It can be turned off/on in SSMS 2005, so possibly in 2008 you have it switched off.
Go to Tools -> Options -> Text Editor -> Editor Tab and Status Bar. Under "Tab Text" in the right hand panel, make sure "Include server name" is set to True.

If you have the SQL Editor menu checked up top then there is a drop down that tells you exactly what database you're in for the currently selected tab.

You should be running any queries in the active window? At the bottom there is a status bar with the server name and database name in it. That way you don't have to clutter the limited tab space with all that data.

Related

Show executed query in Microsoft SQL Server 2016

In MySQL Workbench, after editing a column, table, or whatever, it will show the query for that action.
I could not find a similar feature in SQL Server 2016. I just want to view the SQL for the action I perform, such as editing a column.
Is it possible?
Something I've always set is Auto generate change scripts which can be found within the options:
This shows the script and prompts you to save it.
If I don't want it so that every time I do a change it prompts me I use the Generate Change Script icon (first icon below):
This is usually greyed out until you make a modification then you can click it. However the annoying thing is you have to click the icon to generate the script prior to saving the modification.
Downloaded SSMS 2016
The icon has slightly changed. In 2016 this is what you are looking for:
You will want to use the first icon on the toolbar above.
There is also a menu that appears called Table Designer. From there you can also generate the change script. This isn't a new feature in 2016 it was something I noticed when looking for the icon.

Ctrl R not working in SQL Server 2012

In SQL Server 2012, Ctrl+R not working. Any other shortcuts for that.
Any setting changes available or is there any alternative?
Go to Tools > Options > Environment > Keyboard / General.
In the middle box,
Select Window.ShowResultsPane
Change the Use new shortcut dropdown to SQL Query Editor (Global did not work for me)
Put your cursor in the "Press shortcut keys:" box and hit CTRL + R. You should see the following:
Click Assign and then OK.
Unlike some other changes that still require an SSMS restart to take effect, the change takes effect immediately, and CTRL + R should start working again.
I blogged about this three years ago.
Another way is to select Default and hit the Reset button. This worked for me.
I'm using Microsoft SQL Server Management Studio version 11.0.3128.0 (SSMS 2012).
Started having the above issue for no aparent reason.
Solved like this: click "Tools -> Options". On the options window, open Environment -> Keyboard on the tree. Then, on the right, press the "Reset" button.
Worked for me.
I am using Microsoft SQL Server Management Studio version 12.0.4100.1 (SSMS 2014).
I had the same issue and resolved it by following below steps -
Click "Tools -> Options".
On the Options window, expand Environment -> Keyboard -> Keyboard.
Then, in the right side panel, press the "Reset" button.
Go to the Keyboard Settings as mentioned by #aaron and then change the keyboard mapping scheme (first drop down). This gave me back the shortcuts that I am used to like Ctrl+R and Ctrl+E
I am troubled with this after I installed Visual Studio 2015. When Ctrl+N is pressed in SSMS, instead of opening a query window, SSMS showed up selection page of the VS files. A Reset as posted above revert to SSMS shortcuts.
Thanks for the posts.
--In 'thoughts'...

Edit arbitrary database values with the SQL Server Management Studio GUI

In MySQL Workbench, as long as you can display a row, you can edit it by typing in the cells.
Is there any way to do that with SQL Server Management Studio? SSMS seems limited to providing a GUI editor for the top 200 entries.
You can edit the query used to display the rows to edit by opening the "Query Designer" menu and selecting "Pane"->"SQL".
Once you've made your changes open the "Query Designer" menu and click "Execute SQL".
(Note these commands are also available on the toolbar and have hotkeys associated with them by default).

SMSS IDE: Addon to colour tab or background by server?

I haven't been able to find anything that can colour the background and/or add a tab bar to the SMMS IDE to better identify the difference between prod, test and dev servers. SMSS Tools appears to be the only plugin trying to do this but I'm yet to see it work (appears to be a common problem based on my searches).
Just wondering if anybody knows of an addon (paid or free) that accomplishes this?
All version of SSMS since at least SQL Server 2008 R2 (and I think 2008) include a built-in ability to change the colour of the connection bar at the bottom of a query window - when setting up a new connection for a query, click the Options >> button, then set the colour by ticking use custom colour (then selecting your chosen colour) on the Connection Properties tab.
I've had SSMS Tools Pack connection colouring working but I prefer the built-in option.
EDIT
I just tried SSMS Tools pack colouring again, and I agree it appears not to be working in the current verion (2.1.0) in SSMS 2008 R2.

Query Designer toolbar grayed out?

I am using the Query Designer in SQL Server Management Studio (on an Express 2008 database). I created a new Query, chose Design Query in Editor from the Query toolbar and was presented with a cool graphical query designer (a bit like the one in ACCESS). I selected the fields, which generated the T-SQL, and executed the query and thought awesome! However, I can then only modify the T-SQL manually, I cannot get back into the graphical designer as all the Query Designer toolbar options are grayed out. Am I missing something?
Highlight the query text, then right-click, and select "Design Query in Editor...".