In SSMS, how do I change a SQL query window's tab name?

16,179

Solution 1

In SSMS, go to Tools > Options > Text Editor > Editor Tab and Status Bar.

You can manage some options of tab text, as shown in the picture below.
(for example don't include db name, file name, login name and/or server name).

SQL Server Options

Solution 2

My solution when I've got multiple tabs open is to save the file (Ctrl+S) and then renaming it to the table name—or whatever it needs to be to make the query recognisable at a glance. Go into Tools > Options > Text Editor > Editor Tab and Status bar, and set all tab text to false except for Include file name (set this to True).

Now, when I next execute the query, the Tab text presents the new filename.

Share:
16,179
user3252014
Author by

user3252014

Updated on June 18, 2022

Comments

  • user3252014
    user3252014 about 2 years

    I want to know how to change the tab name of a SQL query window:

    enter image description here

    Instead of SQLQuery8.sql…Registry(sa(51)), I would like to have a custom caption.

    If the query window has a very title, I can only open 3 windows at a time. I want to open more than 10 windows. So I need to change the query window's name to something very short, something like Q1, Q2, etc.

    How can I change this?

  • Raphaël Althaus
    Raphaël Althaus almost 10 years
    @user3252014 yes. And it's only applying when creating a new tab. If you set the 4 to false, you will only get SqlQuery8.sql for example.
  • user3252014
    user3252014 almost 10 years
    is there any way to change this name?
  • Raphaël Althaus
    Raphaël Althaus almost 10 years
    @user3252014 You mean SqlQuery<n> to q<n>, for example ? Don't think so (well at least I donnow how to do this), without saving, but that's not what you're looking for, sadly.
  • user3252014
    user3252014 almost 10 years
    you said if i set 4 to false it will show sqlquery8,sql,i want to know this name i can change or not? or this name coming defalultily..?
  • Raphaël Althaus
    Raphaël Althaus almost 10 years
    @user3252014 and my previous answer (comment) is about that. Donnow if (and if yes how) you can change this default.
  • stakx - no longer contributing
    stakx - no longer contributing almost 10 years
    @user3252014: There's no point in simply repeating your question over and over again. You got an answer. Please consider that what you want might simply be impossible beyond the answer(s) that you've already received.
  • Paul
    Paul over 8 years
    Set the options to only show file name. Then each time you create a new query quickly save it to some c:\temp directory or similar with a useful name. This is what the man Brent Ozar does brentozar.com/archive/2011/06/…
  • klenium
    klenium over 5 years
    Note: you have to reload (ie. save, close and open again) the tab to make changes live.
  • deepak samantaray
    deepak samantaray over 5 years
    Can someone explain how n is calculated here after login in brackets? It looks like changing without any pattern. login (n)?
  • Sнаđошƒаӽ
    Sнаđошƒаӽ over 3 years
    I have always been troubled by this non-sense stuffs in the tab name.. glad those can be changed at least..