Re: strange thing about the SQL method

From: onedaywhen (jamiecollins_at_xsmail.com)
Date: 03/16/05


Date: 16 Mar 2005 04:33:59 -0800


Ron Weiner wrote:
> Because of the structure of your table is there is no "natural"
order.
> Typically when we want data to be in some kind of order we'd use an
Order By
> clause when we retrieve the data.
>
> If you want the data to be in some kind of natural order in the
table, then
> create a Primary Key using all of your columns.

PK or no PK, the rows will be stored in date/time created order until
the file is compacted, at which time the physical order is rebuilt on
the PK if one exists (don't mention 'clustered index': I did and it
upset some people <g>). Even if the PK is a composite comprising all
columns in the table, the new PK order may or may not be in the order
they were created, depending on circumstances.

Jamie.

--


Relevant Pages

  • Re: I need a query
    ... top clause is meaningless if not specified with the order by clause. ... Following example will retrieve the top 20 orders on the basis of the amount ... freight amount. ... declare @from int,@to int ...
    (microsoft.public.sqlserver.mseq)
  • Re: Record source at runtime
    ... Clause, but is in the data requested, so it will return the PKs ... retrieve indexes for Lastname and Firstname. ... had I written the query: ...
    (microsoft.public.access.formscoding)
  • Re: Sql server Views!
    ... You should put a filter in the WHERE clause that defines your view so only ... They are just a glorified SQL command that retrieve whatever ... > I have got copies of the SQL database and their tables. ... > FOREVER to open and it opens in a strange way. ...
    (microsoft.public.fox.helpwanted)
  • Webservice autogenerated proxy class
    ... i am using wsdl.exe to generate a proxy class for a webservice. ... class should retrieve the URL from the App.config file. ... URL used in the else clause, so if you did not trace thru the program, ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: Search Firstname field AND Lastname field?
    ... last name field in my query? ... The WHERE clause is a Boolean logical expression; ... be true in order to retrieve a record, or use the OR operator to ...
    (microsoft.public.access.gettingstarted)