Groups | Blog | Home
all groups > sql server (alternate) > november 2004 >

sql server (alternate) : Indexing in SQL 2000


SuryaPrakash Patel via SQLMonster.com
11/6/2004 10:44:24 PM
Hello Reader

Why I am not seeing the row values as per the index set on the table?
It appears in random manner.

I think it should appear ascending as per the index set for one of the Column in Ascending.


Please guide.

*****************************************
* This message was posted via http://www.sqlmonster.com
*
* Report spam or abuse by clicking the following URL:
* http://www.sqlmonster.com/Uwe/Abuse.aspx?aid=f062d923b9674d47a73eeefbc3df9e58
Hugo Kornelis
11/7/2004 12:03:15 AM
On Sat, 06 Nov 2004 22:44:24 GMT, SuryaPrakash Patel via SQLMonster.com
[quoted text, click to view]

Hi Surya,

The rows will only appear in a specific order if you explicitly request
that order with an ORDER BY clause. Without that, SQL Server is free to
choose any order (and the optimizer will try to choose the order that can
be gotten the quickest).

Best, Hugo
--

SuryaPrakash Patel via SQLMonster.com
11/9/2004 4:26:49 AM
Dear Hugo,

Thanks

I am trying to design a database. How can I make best Judgement that Indexing (which I am trying to fix during Diagram Desingning process)is ok.

I am able to identify the best candidate for the indexing.

Below is the details I want to understand:

Area
ZIP
City
County
District
State/Province
Country

Now I want the data retrival optimization through Index. (you can suggest another idea, also)

Entities Area,...., Country have independent tables.
Example:

Area_Table
AreaID (PK)
Area
They have relationship- one to many- if you go from Country to Area.

There is one more table:

Location_Table (PK)
LocationID
AreaID
ZIPID
CityID
CountyID
DistrictID
State/ProvinceID
CountryID
(Location_ID is further related to the Address of the contact.)

GUI has a single form to enter these details.On a save command details in all the tables -Area to Country- (individually) being inserted.
& simultaniously Location_Table is also being inserted with the details.

Following is the situation of being queried these tables:

(1) GUI user can select an Area than the related details of ZIP .., ..., ...upto Country etc. should be loaded automatically (id it is previously stored by the user entry in the database.)


(2) Contacts have to retrived on the basis of Area, ZIP, .....County. (Necessary Groupings are required )

Example:
If Contacts are queried State Wise then the Display should be

State1
District1
County1
City1
ZIP1
Area1
Area2
ZIP2
City2

County2
District2


Please Guide.

SuryaPrakash

*****************************************
* A copy of the whole thread can be found at:
* http://www.sqlmonster.com/Uwe/Forum.aspx/ms-sql-server/5074
*
* Report spam or abuse by clicking the following URL:
* http://www.sqlmonster.com/Uwe/Abuse.aspx?aid=21cedb8684cc41448b0a1ca5be7a0133
AddThis Social Bookmark Button