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)
 Data sequence

Author  Topic 

Delinda
Constraint Violating Yak Guru

315 Posts

Posted - 2010-03-02 : 10:47:36
I've statement as follow,
declare @data xml
set @data='<data>
<cout><short>kl</short></cout>
<cout><short>jb</short></cout>
<cout><short>sg</short></cout>
</data>'

declare @tCout table
(
idx int identity(1,1),
cout varchar(20)
)
insert into @tCout
select a.b.value('short[1]','varchar(20)')
from @data.nodes('/data/cout') a(b);

Just want to confirm, is that sure the data will insert by sequence as follow,
1st - kl
2nd - jb
3rd - sg

need confirmation

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-03-02 : 10:50:16
why should you be worried in order of insertion? you can always retrieve it in order you want using ORDER BY in SELECT

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

Delinda
Constraint Violating Yak Guru

315 Posts

Posted - 2010-03-02 : 11:00:55
me want to define the path. that why i need to indicate which the record first.
Go to Top of Page

Delinda
Constraint Violating Yak Guru

315 Posts

Posted - 2010-03-02 : 11:11:12
can someone confirm the order of insertion?
Go to Top of Page
   

- Advertisement -