473,385 Members | 1,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Default retrieval from table loaded by DTS

[MS SQL Server 7]

We load a table from a text file using Data Transformation Services. The
source file is already sorted by primary key order.

After the DTS load, the default retrieval order on the target table (select
* from targettable) appears to be random. I know that theoretically the
retrieval order from a SELECT statement isn't guaranteed, but this is the
first time that I've actually had a default retrieval not follow the
primary key order in the table. I'm thinking that what we're seeing is the
physical storage order of the rows in the table, which have been somewhat
scrambled by the way that DTS loads a text file (probably some I/O
optimization).

Is there any way that we can get DTS to load the table in the order that
the rows appear in the text file (assuming that's what our problem is)?
The Project Lead really doesn't like the fact that the default retrieval
order isn't following the primary key.

Regards,
Lyle H. Gray
Jul 20 '05 #1
1 1630
Lyle H. Gray (gr**@no.spam.cs.umass.edu.invalid) writes:
[MS SQL Server 7]

We load a table from a text file using Data Transformation Services. The
source file is already sorted by primary key order.

After the DTS load, the default retrieval order on the target table
(select * from targettable) appears to be random. I know that
theoretically the retrieval order from a SELECT statement isn't
guaranteed, but this is the first time that I've actually had a default
retrieval not follow the primary key order in the table.
You must have been living in a sheltered word. What you can expect is
things like "SELECT * FROM tbl" for small tables to follow the clustered
index (which in many cases is not the PK). For larger tables, this is
less expected, as SQL Server may open parallel streams, you get chunks
have decent order internally, but the chunks themselves appear in a mess.
If you have a WHERE clause, this can lead to another index being used,
leading to another order etc.
Is there any way that we can get DTS to load the table in the order that
the rows appear in the text file (assuming that's what our problem is)?
The Project Lead really doesn't like the fact that the default retrieval
order isn't following the primary key.


Tell your project lead that there is no default retrieval order. If you
want a certain order, use ORDER BY. If you don't use ORDER BY, that
means that you don't care about order.

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

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: linda williams via AccessMonster.com | last post by:
The code creating the recordset that is commented out below works on all my user's machines except two. What is especially irritating is that this code did work on one of their machine for several...
7
by: Aaron Smith | last post by:
How do I set field default values at runtime? Say I want a check box that is bound to a boolean field to default to false for a certain set of criteria, and then true for others? I also need to do...
10
by: Doug Bell | last post by:
Hi, I have an application that has a "Data Access Class" and "User Interface Class". It is for receiving Purchase Order data from one system and pushing processed transactions to another...
1
by: kalulu | last post by:
Clinic Visits form is done at 3,6,9,12,15,18 and 24 months. The same table (VISITS) is used repetitively during the study. Timepoint is recorded in the table variable VISMO (visit month). When we...
12
by: Doogie | last post by:
How do I make a value the default value for a combo box in ASP 3.0? What I have below does NOT work, yet I've seen it in HTML file examples before (and works if I put it in a HTML file by itself,...
12
by: grace | last post by:
i am wondering why my database retrieval becomes too slow...we set up a new server (ubuntu, breezy badger) machine where we transferred all our files from the old server.. Our new server uses Asus...
0
by: JosAH | last post by:
Greetings, Introduction At the end of the last Compiler article part I stated that I wanted to write about text processing. I had no idea what exactly to talk about; until my wife commanded...
0
by: JosAH | last post by:
Greetings, the last two article parts described the design and implementation of the text Processor which spoonfeeds paragraphs of text to the LibraryBuilder. The latter object organizes, cleans...
2
by: Jeff | last post by:
Hi I'm trying to achieve a scenario where I have c# files that are compiled dynamically, the assemblies are then loaded in a different AppDomain, I call a simple method from the object, and then...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.