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 |
|
Yellowdog
Starting Member
34 Posts |
Posted - 2009-12-10 : 11:43:50
|
| I have a table with one column and with Name in one row followed by address (city state zip) in the next row.I need to parse this into another table with a simple record in each rowname address city state zip.parsing the name and address into separate columns is not a problem, what is is getting the every other row into one row.Any help would be great! |
|
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2009-12-10 : 12:02:43
|
| This is an absolutely useless design. Without any way to tie a name record to an address record there is no way to guarantee correct results.The reason is because the sort order is not guaranteed to be in the order you want without specifying an ORDER BY clause. So a name may end up being matched with the wrong address.You can identify the address records WHERE fieldName LIKE'%[0123456789]%' but how to tie it to the proper name...If this perhaps came from an Excel sheet, go back to Excel and add an ID column, and put incrementing #s in it. Then we can help you with something that'll work |
 |
|
|
Yellowdog
Starting Member
34 Posts |
Posted - 2009-12-10 : 12:05:34
|
| yah thats the problem, this is a file downloaded off an old unix system and comes in as a txt file with the name in one row and address in the following row.so I need to find a way to get this data in a workable table. |
 |
|
|
RyanRandall
Master Smack Fu Yak Hacker
1074 Posts |
|
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2009-12-10 : 12:27:25
|
| first pop it into Excel. Then add a column and put numbers in it. then import to SQL with the #s. Then it's easy -- odd is name, even is address |
 |
|
|
|
|
|