SQL server 2008 - rows are mixed when inserting into another table -
i have 1 store procedure , inside 1 used 4 tables(tb1,tb2,tb3,rs1).each table has 1 column(x-varchar type).starting of procedure deleted existing rows in contents first 3 tables except rs1 ll insert 10 15 rows in 3 tables.. end of procedure ll insert 3 tables data rs1 using 3 insert statements(first rs1,rs2 , rs3). issue when select rows rs1,few ts3 rows in first 2 rows of rs1 has rs1 data ts2 value missing ts3 rows..also not happened times... i'm not able find out reason this...
tb1 value ---------- arun address state tb2 value ---------- product1 product2 product3 tb3 value --------- productname1 productname2 productname3
after i'm inserting data rs1 this
insert rs1 select x ts1 insert rs1 select x ts2 insert rs1 select x ts3
result coming below
productname2 productname3 name address state product1 product2 product3 productname1
database tables not ordered nature.
getting results in random since there nothing order them by. if add column rs1 can order it, such datetime
column default value of getdate()
, or identity
column, can use data in order you've inserted table.
Comments
Post a Comment