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.
| Author |
Topic |
|
awalsql
Starting Member
11 Posts |
Posted - 2008-09-18 : 22:53:48
|
| How to create NEW SEQ number and migrate in this situation?In the Source table each order#has two sets of comments: DATA SET1 and DATA SET2.I need to migrate this into a new table with NEW SEQ.In the destination tableI have two Comment fields and two Flag FieldsPlease helpActual TableOrder#__OLD Seq__Comment(25)______________Flag001_____1________So VP____________________DataSet1001_____2________Complete Today___________DataSet1001_____1________Order22__________________DataSet2001_____2________Dispatch today___________DataSet2002_____1________Group4___________________DataSet1002_____2________supply will be___________DataSet1002_____3________processsed_______________DataSet1 002_____1________So#555 rlsd_____________DataSet2Destination TableOrdr#_NewSq_Com1(Chr25)_Com2(chr25)_____Flg1_______Flg2001____1____So Vp_______Complete today__DataSet1___DataSet1001____2____Order22_____Dispatch today__DataSet2___DataSet2002____1____Group4______Supply will be__DataSet1___DataSet1002____2____processed___So#555 rlsd____DataSet1___DataSet2 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-09-19 : 01:13:21
|
if you are using SQL Server 2005 use the row_number() function KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
awalsql
Starting Member
11 Posts |
Posted - 2008-09-19 : 09:03:55
|
| Unfortunately, I am using SQl2000 |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2008-09-19 : 09:35:51
|
quote: Originally posted by khtan if you are using SQL Server 2005 use the row_number() function KH[spoiler]Time is always against us[/spoiler]
Did you read this?That won't help...you are looking to crosstab this...but you kinda need to know which values for order number is "first"..is there a dayetime column on the row?For example, in your Order#001, how do you know the pairs belong to each other...it get's worse if S3q > 2Brett8-)Hint: Want your questions answered fast? Follow the direction in this linkhttp://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspxAdd yourself!http://www.frappr.com/sqlteam |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-09-19 : 09:39:58
|
| is there a field which contain unique values in yourtable? |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-09-19 : 23:25:24
|
Why do you want to un-normalized your table ? KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
|
|
|