Row Order
From: Guadala Harry (GMan_at_NoSpam.com)
Date: 11/02/04
- Next message: crbd98_at_yahoo.com: "Re: Bottleneck in client notification design"
- Previous message: Mark Wilden: "Re: How ">=" Work on Varchar field?"
- Next in thread: Aaron [SQL Server MVP]: "Re: Row Order"
- Reply: Aaron [SQL Server MVP]: "Re: Row Order"
- Reply: Kalen Delaney: "Re: Row Order"
- Reply: Tom Moreau: "Re: Row Order"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 2 Nov 2004 10:06:13 -0800
I'm inserting rows into a temp table via a SELECT statement that has an
ORDER BY clause because I need for the rows to exist in the temp table in
the order specified by the ORDER BY clause.
The temp table is just a few varchar and int columns with an IDENTITY
property and NO indexes.
Someone told me that there was no guarantee that the rows would get inserted
into the temp table in the order specified by the ORDER BY Clause.
Is this true? If so, why - and what can be done to "guarantee" that the row
ordering corresonds to the order returned by the SELECT statement?
Here's what the setup looks like to which the person was commenting:
USE PUBS
CREATE TABLE #TEMP_TABLE
(
RowNumber [int] IDENTITY,
City varchar(40),
State varchar(40)
)
INSERT INTO #TEMP_TABLE (city, state)
SELECT city, state
FROM stores
ORDER BY stor_id
Thanks.
- Next message: crbd98_at_yahoo.com: "Re: Bottleneck in client notification design"
- Previous message: Mark Wilden: "Re: How ">=" Work on Varchar field?"
- Next in thread: Aaron [SQL Server MVP]: "Re: Row Order"
- Reply: Aaron [SQL Server MVP]: "Re: Row Order"
- Reply: Kalen Delaney: "Re: Row Order"
- Reply: Tom Moreau: "Re: Row Order"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|