Home | User-Defined Functions | Tips & Tricks | SQL Server 2005 | Forums | Frequently Asked Questions | Practice Test |    
SQL Server Helper Forum
SQL Server Helper Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000/2005
 SQL Server Beginners
 Table Sorting
 New Topic  Reply to Topic
 Printer Friendly
Author  Topic Next Topic  

David

2 Posts

Posted - 06/06/2009 :  13:43:11  Show Profile  Reply with Quote
Hello,

I have the following table and fields:

tbl_ItemTypes
PK_fldID (bigint; Identity)
fld_Description (varchar)

I have created an index on fld_Description to prevent duplicate records.

When I open the table in Management Studio Express, the data in the table is sorted by fld_Description. What I would like to see when I open the table is to see the data sorted by PK_fldID. Is this possible?

Thank You

David

sshelper

USA
110 Posts

Posted - 06/07/2009 :  21:25:27  Show Profile  Visit sshelper's Homepage  Reply with Quote
To guarantee the sorting of how the data is shown in Management Studio or in any SELECT statement you issue, you must always provide the ORDER BY clause. If there's no ORDER BY clause in your SELECT statement, the sorting of the data will be in the order SQL Server retrieved the data. The data may be in memory or it may be retrieved from the data files but the order may not always be in the same sorting every time you view the data in Management Studio. Just remember that in Management Studio, it simply sends out a SELECT statement just the same way you would type it manually.
Go to Top of Page
   Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
   
SQL Server Helper Forum © 2006 SQL Server Helper Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.06