Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 order missing identity column

Author  Topic 

Ranjit.ileni
Posting Yak Master

183 Posts

Posted - 2011-03-10 : 05:29:22
Hi experts,

table:

CREATE TABLE dbo.ATP_MD_PROJECT_ITEMS
(
ITEM_ID integer NOT NULL IDENTITY(1,1)
,ITEM_DESCRIPTION varchar(50)

)

Format file :ATP_MD_PROJECT_ITEMS.fmt
9.0
1
1 SQLCHAR 0 50 "\r\n" 2 ITEM_DESCRIPTION SQL_Latin1_General_CP1_CI_AS


text data file:ATP_MD_PROJECT_ITEMS.txt
ferry
bus
flight

I imported data from text file to table

now

select * from ATP_MD_PROJECT_ITEMS

output :
ITEM_ID ITEM_DESCRIPTION
2 bus
1 ferry
3 flight

-- records are not in order in

my expected result is:

ITEM_ID ITEM_DESCRIPTION
1 ferry
2 bus
3 flight

Please help me.


Thanks,








--Ranjit

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2011-03-10 : 05:39:19
There is no reliable order in a sql table.
You always have to use ORDER BY if you need a result set in specific order.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

Ranjit.ileni
Posting Yak Master

183 Posts

Posted - 2011-03-10 : 05:53:11
Thank you webfred,

quote:
Originally posted by webfred

There is no reliable order in a sql table.
You always have to use ORDER BY if you need a result set in specific order.



I thought mistake happens in some where...
Now my dought was Clarified(There is no reliable order in a sql table.)

--Ranjit
Go to Top of Page
   

- Advertisement -