If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
Create a copy of the table, then write a series of UPDATE statements.
Such as :=
UPDATE mytable SET col3 = col4,col4 = 6 ,assuming that is the correct pattern
As long as there is a pattern , then this should work.=
Ensure you've backedup prior to starting
When you can write the contents of Column3, Column4, ... column6 in Column2, that means they all contain the same kind of data.
Your database should be normalised:
column1|column2|column3|column4|column5|column6
should be normalised into:
column1|column2
ABC|22222222|null|33333333|33333333|44444444
Will become:
ABC|22222222
ABC|33333333
ABC|33333333
ABC|44444444
GHI|88888888|null|null|99999999|00000000
Will become
GHI|88888888
GHI|99999999
GHI|00000000
__________________
With kind regards . . . . . SQL Server 2000/2005/2008/2008 R2 Earned beers: 16
Wim
Beware of bugs in the above code; I have only proved it correct, not tried it. -- Donald Knuth
Grabel's Law: 2 is not equal to 3 -- not even for very large values of 2. Pat Phelan's Law: 2 very definitely CAN equal 3 -- in at least two programming languages