473,809 Members | 2,781 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

inserts and select

3 New Member
If I insert rows in a table with no index, is select guaranteed to return the rows in the order it was inserted.
Note: I am not doing any updates, deletes - pure inserts.
In my small test that I did, it always retrieves in the order I inserted. But not sure if there are any case where it can retrieve in a different order.
Jan 31 '07 #1
2 1335
michaelb
534 Recognized Expert Contributor
I think you should not make any assumptions about the default select order.
If you have no idexes, and you did not run any UPDATEs on the table you may find that in most cases you get your result sorted by ROWID (that is in the same order the rows were created).
However there's no quarantee that this would be always the case; just as you cannot expect that ROWIDs are always in sync with the INSERT order.
Feb 1 '07 #2
MihirShah
3 New Member
I think you should not make any assumptions about the default select order.
If you have no idexes, and you did not run any UPDATEs on the table you may find that in most cases you get your result sorted by ROWID (that is in the same order the rows were created).
However there's no quarantee that this would be always the case; just as you cannot expect that ROWIDs are always in sync with the INSERT order.
thanks for your reply. That's exactly what I want to find out under what circumstances will this happen ? If I am inserting let's say 1000 rows in one transaction, under what circumstances will the ROWIDs will not be in sync with the insert order ?
Feb 5 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
1998
by: J Smith | last post by:
After doing some googling through the lists and such, I wasn't able to arrive at a solution for a problem I've run into recently. I've seen mention of similar symptoms, but my case seems different. After recently upgrading to 7.3.4 from 7.3.1, I started having problems with using subselects in INSERTs. I'm seeing things like this (simplified, as this is a part of a larger database): INSERT INTO t1 (name) VALUES ('foo'); INSERT 123 1
5
1752
by: Florence HENRY | last post by:
Hello, well, almost everything is in the subject ! I have to fill 2 tables (more complicated than in the example !): CREATE TABLE A ( id serial primary key, foo text);
2
4364
by: simonZ | last post by:
I create a transaction: sqlTran=sqlConn.BeginTransaction(IsolationLevel.Serializable); Then, I insert some data into report table with sqlCommand object: oCmd = new SqlCommand("c_reportInsert", sqlConn); oCmd.CommandType = CommandType.StoredProcedure; oCmd.Transaction = sqlTran; .... ....
3
2361
by: Rob | last post by:
Hi all, I have a bit of a complicated question, hope we have an SQL guru out there that can help us solve this killer problem. Due to the size of SQL Database we have (largest in the US), we try to pre-process large data files in IO until we are ready to insert directly into the database via BCP (quick, no constraints, no mess... well um that's the problem)
0
2350
by: dustwel | last post by:
I am currently trying to write a trigger that when an insert or update is made to a table, it inserts a copy of the row into a log table. It currently works when one row is inserted, but it will error if you try to do multiple inserts or modifies to the same table. Do I need a loop to do this, or what do you guys suggest? My code is as follows. Thanks! CREATE TRIGGER trgTestLogging ON dbo.test FOR INSERT, UPDATE AS DECLARE @productID...
2
2230
by: sangam56 | last post by:
Greetings. I suppose people out there can help in my problem. I am using sql server of microsoft visual studio 2005 itself. I have created a stored procedure which is give below. It works fine but it always inserts two records into the database. All columns of the two rows are same but the primary key is different which is no surprise. Please help me get out of this problem. -------------------------------- code goes here...
18
1702
by: Charles Law | last post by:
I have a sproc that returns data from a table using a simple SELECT. There are quite a few rows returned, e.g. ~150,000. In my first application, I use a reader on the sproc and iterate through the rows, writing them out to a file. This takes about 5 minutes until I close the reader. Whilst this is going on, I have another application that is trying to insert rows into the table. Normally, the inserts happen straight away, but when...
9
3211
by: lenygold via DBMonster.com | last post by:
I have the following trigger: --#SET TERMINATOR ! CREATE TRIGGER CROSS_REFF_TRIG AFTER INSERT ON NEW_CATALOG REFERENCING NEW AS nnn FOR EACH ROW MODE DB2SQL BEGIN ATOMIC DECLARE reason VARCHAR(70); DECLARE OUT_SQLCODE1 INTEGER;
0
9721
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9602
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10383
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7661
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6881
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5688
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3861
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.