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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 record shuffling

Author  Topic 

khajakamal
Starting Member

5 Posts

Posted - 2008-12-22 : 06:20:47
i inserted more number of records in sqlexpress but the inserting record orders are changed. Anybody have the solution to fix this problem in sqlexpress

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-12-22 : 06:22:36
Why are order of records important to you?



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

khajakamal
Starting Member

5 Posts

Posted - 2008-12-22 : 06:24:32
because i want show the records in inserting order
Go to Top of Page

khajakamal
Starting Member

5 Posts

Posted - 2008-12-22 : 06:25:53
because i want show the records in inserting order
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-12-22 : 06:27:22
The only way to EVER guarantee a sorting order is to use ORDER BY clause.
Microsft SQL Server is not similar to Microsoft Access.


E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

khajakamal
Starting Member

5 Posts

Posted - 2008-12-22 : 06:29:11
but i have all column type is Uniqueidentifier so i can't use the order by clause
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-12-22 : 06:33:32
Yes you can!
ORDER BY CAST(uidcol AS CHAR(36))



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

khajakamal
Starting Member

5 Posts

Posted - 2008-12-23 : 00:27:56
sorry ORDER BY CAST(uidcol AS CHAR(36)) it return wrong order result
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-12-23 : 06:56:06
What is "right" order, as opposite to "wrong" order?



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page
   

- Advertisement -