Home All Groups Group Topic Archive Search About

SSMS explorer. Sorting the columns names in a table.

Author
24 Feb 2009 1:31 PM
Oriane
Hi there,

I would like to know if we can sort the columns name of a table by default
in the SSMS 2005/2008 explorer.
I would like to display first the primary, unique and foreign keys columns,
then the rest of them, alphabetically sorted.

Best regards

Author
6 Feb 2009 2:27 PM
Aaron Bertrand [SQL Server MVP]
No, there is no such functionality.


On 2/24/09 8:31 AM, in article efXZG#FiJHA.***@TK2MSFTNGP03.phx.gbl,
Show quoteHide quote
"Oriane" <oriane@noemail.noemail> wrote:

> Hi there,
>
> I would like to know if we can sort the columns name of a table by default
> in the SSMS 2005/2008 explorer.
> I would like to display first the primary, unique and foreign keys columns,
> then the rest of them, alphabetically sorted.
>
> Best regards
>
Are all your drivers up to date? click for free checkup

Author
6 Feb 2009 3:41 PM
Oriane
Hi Aaron,
"Aaron Bertrand [SQL Server MVP]" <ten.xoc@dnartreb.noraa> a écrit dans le
message de news:C5B1B2E8.EABC%ten.xoc@dnartreb.noraa...
> No, there is no such functionality.
So, is there a simple way to "manually" sort the columns of a table via SQL
(when the column is alreday filled with data) ?

Thank you (I have reset the system clock :-)).
Author
6 Feb 2009 10:50 PM
Erland Sommarskog
Oriane (oriane@noemail.noemail) writes:
> So, is there a simple way to "manually" sort the columns of a table via
> SQL (when the column is alreday filled with data) ?

If you want to change the table definition to reflect the desired order,
you will have to go the long road, and create a new table, migrate
data over, move referencing foreign keys etc. Certainly an advanced
operation, which requires good understanding of what you are doing.

--
Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Author
6 Feb 2009 2:43 PM
Aaron Bertrand [SQL Server MVP]
(Also can you please fix your system clock; it is not 2/24 in any part of
the world I'm aware of...)


On 2/24/09 8:31 AM, in article efXZG#FiJHA.***@TK2MSFTNGP03.phx.gbl,
Show quoteHide quote
"Oriane" <oriane@noemail.noemail> wrote:

> Hi there,
>
> I would like to know if we can sort the columns name of a table by default
> in the SSMS 2005/2008 explorer.
> I would like to display first the primary, unique and foreign keys columns,
> then the rest of them, alphabetically sorted.
>
> Best regards
>
Author
6 Feb 2009 4:05 PM
Ekrem_Önsoy
You just can sort columns alphabetically (ascending or descenting) using
SSMS' s Object Explorer Details.

--
Ekrem Önsoy



Show quoteHide quote
"Oriane" <oriane@noemail.noemail> wrote in message
news:efXZG%23FiJHA.760@TK2MSFTNGP03.phx.gbl...
> Hi there,
>
> I would like to know if we can sort the columns name of a table by default
> in the SSMS 2005/2008 explorer.
> I would like to display first the primary, unique and foreign keys
> columns, then the rest of them, alphabetically sorted.
>
> Best regards
Author
6 Feb 2009 5:13 PM
Oriane
Hi Ekrem,
"Ekrem Önsoy" <ek***@compecta.com> a écrit dans le message de
news:910A0F22-C24B-4818-90DF-A7817B783105@microsoft.com...
> You just can sort columns alphabetically (ascending or descenting) using
> SSMS' s Object Explorer Details.
Can you be more precise ?

Best regards
Author
7 Feb 2009 10:25 AM
Ekrem_Önsoy
Open up SSMS and connect to your SQL Server instance.

Then expand Databases node and at the right side, you'll see Object Explorer
Details tab by default. If it's not open, then you can use View -> Object
Explorer Details menu to open it. In this tab, you'll find column headers
such as "Name" and when you click on this column header once, you'll see
that it'll sort the items by their names and if you click again, it'll sort
them descending.

--
Ekrem Önsoy



Show quoteHide quote
"Oriane" <oriane@noemail.noemail> wrote in message
news:030EFEFE-92FB-4370-A81C-A75626AACB04@microsoft.com...
> Hi Ekrem,
> "Ekrem Önsoy" <ek***@compecta.com> a écrit dans le message de
> news:910A0F22-C24B-4818-90DF-A7817B783105@microsoft.com...
>> You just can sort columns alphabetically (ascending or descenting) using
>> SSMS' s Object Explorer Details.
> Can you be more precise ?
>
> Best regards
Author
9 Feb 2009 7:56 AM
Oriane
Hi Ekrem,

You made me discover something !

Thanks
Author
9 Feb 2009 9:35 AM
Ekrem_Önsoy
Enjoy it mate =)

--
Ekrem Önsoy



Show quoteHide quote
"Oriane" <oriane@noemail.noemail> wrote in message
news:53DA723A-9520-4262-A240-13AAC42CBE29@microsoft.com...
> Hi Ekrem,
>
> You made me discover something !
>
> Thanks
Author
9 Feb 2009 8:46 AM
Mark Han[MSFT]
Hi Oriane,
Thank you for using Microsoft MSDN Managed Newsgroup. My name is Mark Han.
I am glad to work with you on this issue.

From your description, I understand that you would like to sort the column
as the following. display first the primary, unique and foreign keys
columns and then display the rest as alphabetically sorted. If I have
misunderstood, please let me know.

Based on my research, it seems that there is no such function to meet your
requirement. However we can display the columns  alphabetically in SQL 2008

Besides, I have apply your requirement to our dev team, if anything
updated, i will public it.

If there is anything unclear, please do not hesitate to let me know.

Have a nice day.

Best regards,
Mark Han
Microsoft Online Community Support
===========================================================
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: msd***@microsoft.com.
===========================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or
a Microsoft Support Engineer within 2 business day is acceptable. Please
note that each follow up response may take approximately
2 business days as the support professional working with you may need
further investigation to reach the most efficient resolution.
The offering is not appropriate for situations that require urgent,
real-time or phone-based interactions. Issues of this nature are
best handled working with a dedicated Microsoft Support Engineer by
contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx

============================================================
This posting is provided "AS IS" with no warranties, and conf

Bookmark and Share